UNPKG

@tarojs/components

Version:
47 lines (43 loc) 1.25 kB
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client'; import { c as classnames } from './index2.js'; const Icon = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement { constructor() { super(); this.__registerHost(); this.type = undefined; this.size = '23'; this.color = undefined; } render() { const { type, size, color } = this; const iconType = type === null || type === void 0 ? void 0 : type.replace(/_/g, '-'); const cls = classnames({ [`weui-icon-${iconType}`]: true }); const style = { 'font-size': `${size}px`, color }; return (h(Host, { class: cls, style: style })); } }, [0, "taro-icon-core", { "type": [1], "size": [8], "color": [1] }]); function defineCustomElement$1() { if (typeof customElements === "undefined") { return; } const components = ["taro-icon-core"]; components.forEach(tagName => { switch (tagName) { case "taro-icon-core": if (!customElements.get(tagName)) { customElements.define(tagName, Icon); } break; } }); } const TaroIconCore = Icon; const defineCustomElement = defineCustomElement$1; export { TaroIconCore, defineCustomElement };