UNPKG

@yzfe/vue3-svgicon

Version:

SVG icon component for vue

62 lines (59 loc) 1.42 kB
import { defineComponent, h } from 'vue'; import { svgIcon } from '@yzfe/svgicon'; export { setOptions } from '@yzfe/svgicon'; var VueSvgIcon = defineComponent({ props: { /** icon data */ data: { type: Object, }, width: { type: [String, Number], }, height: { type: [String, Number], }, scale: { type: [String, Number], }, dir: { type: String, }, color: { type: [String, Array], }, stopColors: { type: Array, }, title: { type: String, }, fill: { type: Boolean, default: true, }, original: { type: Boolean, default: false, }, replace: { type: Function, }, }, render: function () { var result = svgIcon(this.$props); return h('svg', { viewBox: result.box, style: result.style, class: result.className, innerHTML: result.path, }); }, }); var VueSvgIconPlugin = { install: function (app, options) { app.component(options.tagName, VueSvgIcon); }, }; export { VueSvgIcon, VueSvgIconPlugin }; //# sourceMappingURL=index.esm.js.map