feat: 去除unplugin-icons插件相关逻辑,引入vite-plugin-svg-icons插件封装SvgIcon组件

This commit is contained in:
rd
2025-07-18 11:08:09 +08:00
parent 6c2b3b557e
commit 69c7415aea
15 changed files with 69 additions and 37 deletions

View File

@ -1,7 +1,7 @@
<template>
<div class="right-wrap">
<!-- 下载中心 -->
<icon-download
<SvgIcon
name="svg-taskCenter"
size="16"
class="cursor-pointer color-#737478 hover:color-#6D4CFE mr-12px"
@click="openDownloadCenter"

View File

@ -0,0 +1,35 @@
<template>
<svg
aria-hidden="true"
class="svg-icon"
:width="props.size"
:height="props.size"
>
<use :xlink:href="symbolId" :fill="props.color" />
</svg>
</template>
<script setup>
import { computed } from "vue";
const props = defineProps({
prefix: {
type: String,
default: "icon",
},
name: {
type: String,
required: true,
},
color: {
type: String,
default: "#333",
},
size: {
type: String,
default: "12",
},
});
const symbolId = computed(() => `#${props.prefix}-${props.name}`);
</script>