@wfrog/vc
Version:
vue3 组件库 vc
55 lines (49 loc) • 1.77 kB
JavaScript
import './index.css'
import { defineComponent, computed, createElementBlock, openBlock, normalizeStyle, normalizeClass, unref, createBlock, resolveDynamicComponent } from 'vue';
import { _ as _sfc_main$1 } from '../awesome-icon/awesome-icon.mjs';
import { C as Component$2 } from '../el-icon/el-icon.mjs';
import { C as Component$1 } from '../svg-icon/svg-icon.mjs';
import { _ as _export_sfc } from '../../chunk/pcqpp-6-.mjs';
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "icon",
props: {
name: {},
type: {},
color: {},
size: {}
},
setup(__props) {
const props = __props;
const components = { awesome: _sfc_main$1, el: Component$2, svg: Component$1 };
const mySize = computed(() => {
if (props.size && Number.isNaN(+props.size)) {
return props.size;
}
return `${props.size}px`;
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock("i", {
class: normalizeClass(["svg-icon-box", [_ctx.$style.box]]),
style: normalizeStyle({ fontSize: unref(mySize), color: __props.color })
}, [
(openBlock(), createBlock(resolveDynamicComponent(components[__props.type]), {
name: __props.name,
class: "site-icon"
}, null, 8, ["name"]))
], 6);
};
}
});
/* unplugin-vue-components disabled */const box = "_box_1wvpk_1";
const style0 = {
box: box
};
const cssModules = {
"$style": style0
};
const Component = /* @__PURE__ */ _export_sfc(_sfc_main, [["__cssModules", cssModules]]);
const __vite_glob_0_18 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
__proto__: null,
default: Component
}, Symbol.toStringTag, { value: 'Module' }));
export { Component as C, __vite_glob_0_18 as _ };