我们还可以把上面的代码进行改造直接使用在 icon.vue (svg/index.vue)改造 <template><icon:name="icon-shanchu"></icon><icon:name="icon-shanchu1"></icon><icon:name="more"></icon><svgt="1673881805558"class="icon"viewBox="0 0 1024 1024"version="1.1"xmlns="http://www.w3.org/2000/svg"...
import'element-plus/dist/index.css' importsvgIcon from"@/components/SvgIcon/index.vue"; import'virtual:svg-icons-register' createApp(App) .use(ElementPlus) .use(router) .component('svg-icon',svgIcon) .mount('#app') 页面使用 <template> <svg-iconv-if="props.icon":name="props.icon"/> ...
import'element-plus/dist/index.css' importsvgIcon from"@/components/SvgIcon/index.vue"; import'virtual:svg-icons-register' createApp(App) .use(ElementPlus) .use(router) .component('svg-icon',svgIcon) .mount('#app') 页面使用 <template> <svg-iconv-if="props.icon":name="props.icon"/> ...