UNPKG

st-common-ui-vue3

Version:

小尾巴通用 Vue3 UI 组件库

38 lines (37 loc) 1.21 kB
import { defineComponent as i, ref as a, onBeforeMount as r, watch as l, openBlock as s, createBlock as f, unref as d, normalizeStyle as h } from "vue"; import { isStr as m } from "../../node_modules/.pnpm/st-common-core@0.1.1/node_modules/st-common-core/es/str/utils/str-util.js"; import { Icon as u, getIcon as p } from "../../node_modules/.pnpm/@iconify_vue@4.1.2_vue@3.5.13_typescript@5.6.2_/node_modules/@iconify/vue/dist/iconify.js"; const S = /* @__PURE__ */ i({ name: "StIconIconify", __name: "StIconIconify", props: { icon: {}, width: { default: "1em" }, height: { default: "1em" }, color: {}, style: {}, load: { type: Function, default: () => { } } }, setup(c) { const o = c, e = a(o.icon), t = () => { m(o.icon) && (e.value = p(o.icon) || o.icon); }; return r(async () => { t(); }), l(() => o.icon, () => { t(); }), (n, y) => (s(), f(d(u), { class: "st-icon-iconify", icon: e.value, width: n.width, height: n.height, color: n.color, style: h(n.style), onLoad: n.load }, null, 8, ["icon", "width", "height", "color", "style", "onLoad"])); } }); export { S as default };