tav-ui
Version:
57 lines (52 loc) • 1.61 kB
JavaScript
;
Object.defineProperty(exports, '__esModule', { value: true });
var vue = require('vue');
var pluginVue_exportHelper = require('../../../../_virtual/plugin-vue_export-helper.js');
const _sfc_main = vue.defineComponent({
name: "SvgIcon",
props: {
prefix: {
type: String,
default: "icon"
},
name: {
type: String,
required: true
},
size: {
type: [Number, String],
default: 16
},
spin: {
type: Boolean,
default: false
}
},
setup(props) {
const prefixCls = "ta-icon-svg";
const symbolId = vue.computed(() => `#${props.prefix}-${props.name}`);
const getStyle = vue.computed(() => {
const { size } = props;
let s = `${size}`;
s = `${s.replace("px", "")}px`;
return {
width: s,
height: s
};
});
return { symbolId, prefixCls, getStyle };
}
});
const _hoisted_1 = ["xlink:href"];
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return vue.openBlock(), vue.createElementBlock("svg", {
class: vue.normalizeClass([_ctx.prefixCls, _ctx.$attrs.class, _ctx.spin && "svg-icon-spin"]),
style: vue.normalizeStyle(_ctx.getStyle),
"aria-hidden": "true"
}, [
vue.createElementVNode("use", { "xlink:href": _ctx.symbolId }, null, 8, _hoisted_1)
], 6);
}
var IconSvg = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/tav-ui/tav-ui/packages/components/icon-svg/src/icon-svg.vue"]]);
exports["default"] = IconSvg;
//# sourceMappingURL=icon-svg2.js.map