UNPKG

@tarojs/components

Version:
26 lines (23 loc) 679 B
import { r as registerInstance, h, H as Host } from './index-980f930f.js'; import { c as classnames } from './index-c3e4004b.js'; const Icon = class { constructor(hostRef) { registerInstance(this, hostRef); 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 })); } }; export { Icon as taro_icon_core };