st-common-ui-vue3
Version:
小尾巴通用 Vue3 UI 组件库
40 lines (39 loc) • 1.64 kB
JavaScript
import { defineComponent as c, ref as l, onBeforeMount as r, watch as f, openBlock as s, createBlock as d, unref as m, normalizeStyle as u } from "vue";
import { isStr as i } from "../../node_modules/.pnpm/st-common-core@0.1.1/node_modules/st-common-core/es/str/utils/str-util.js";
import { getIcon as h, loadIcon as p, addIcon as y } from "../../node_modules/.pnpm/@iconify_vue@4.1.2_vue@3.5.13_typescript@5.6.2_/node_modules/@iconify/vue/dist/iconify.js";
import { Icon as v } from "../../node_modules/.pnpm/@iconify_vue@4.1.2_vue@3.5.13_typescript@5.6.2_/node_modules/@iconify/vue/dist/offline.js";
import w from "../../node_modules/.pnpm/@iconify-icons_tabler@1.2.95/node_modules/@iconify-icons/tabler/error-404.js";
const L = /* @__PURE__ */ c({
name: "StIconIconifyOffline",
__name: "StIconIconifyOffline",
props: {
icon: {},
width: { default: "1em" },
height: { default: "1em" },
color: {},
style: {},
load: { type: Function, default: () => {
} }
},
setup(t) {
const n = t, o = l(n.icon), a = async () => {
i(n.icon) && (o.value = h(n.icon), o.value || (o.value = await p(n.icon).catch((e) => Promise.resolve(e)), i(o.value) ? o.value = w : y(n.icon, o.value)));
};
return r(async () => {
await a();
}), f(() => n.icon, async () => {
await a();
}), (e, I) => (s(), d(m(v), {
class: "st-icon-iconify-offline",
icon: o.value,
width: e.width,
height: e.height,
color: e.color,
style: u(e.style),
onLoad: e.load
}, null, 8, ["icon", "width", "height", "color", "style", "onLoad"]));
}
});
export {
L as default
};