UNPKG

@tarojs/components

Version:
93 lines (92 loc) 2.22 kB
import { h, Host } from '@stencil/core'; import classNames from 'classnames'; export class Icon { constructor() { 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 })); } static get is() { return "taro-icon-core"; } static get originalStyleUrls() { return { "$": ["./style/index.scss"] }; } static get styleUrls() { return { "$": ["./style/index.css"] }; } static get properties() { return { "type": { "type": "string", "mutable": false, "complexType": { "original": "Type", "resolved": "\"cancel\" | \"clear\" | \"download\" | \"info\" | \"search\" | \"success\" | \"success_no_circle\" | \"waiting\" | \"warn\"", "references": { "Type": { "location": "local" } } }, "required": false, "optional": false, "docs": { "tags": [], "text": "" }, "attribute": "type", "reflect": false }, "size": { "type": "any", "mutable": false, "complexType": { "original": "string | number", "resolved": "number | string", "references": {} }, "required": false, "optional": false, "docs": { "tags": [], "text": "" }, "attribute": "size", "reflect": false, "defaultValue": "'23'" }, "color": { "type": "string", "mutable": false, "complexType": { "original": "string", "resolved": "string", "references": {} }, "required": false, "optional": false, "docs": { "tags": [], "text": "" }, "attribute": "color", "reflect": false } }; } }