feat: 去除unplugin-icons插件相关逻辑,引入vite-plugin-svg-icons插件封装SvgIcon组件
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 571 B After Width: | Height: | Size: 571 B |
|
Before Width: | Height: | Size: 984 B After Width: | Height: | Size: 984 B |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
3
src/assets/svg/svg-taskCenter.svg
Normal file
@ -0,0 +1,3 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">
|
||||
<path d="M9.2041 2.32617C11.6897 2.32617 13.7595 4.10156 14.2178 6.45312C15.2902 7.15513 16 8.36571 16 9.74316C16 11.9142 14.2393 13.6738 12.0684 13.6738H3.93066C1.75983 13.6736 3.83345e-05 11.9141 0 9.74316C0 9.63068 0.00538693 9.51927 0.0146484 9.40918C0.00563418 9.29576 7.49779e-06 9.18117 0 9.06543C0 6.69938 1.91817 4.78127 4.28418 4.78125C4.46476 4.78126 4.64268 4.79275 4.81738 4.81445C5.70979 3.32391 7.34052 2.32633 9.2041 2.32617ZM9.2041 3.52539C7.77983 3.52555 6.53145 4.28786 5.84668 5.43164L5.44531 6.10156L4.66992 6.00586C4.53994 5.9897 4.41129 5.98048 4.28418 5.98047C2.6345 5.98048 1.28692 7.27669 1.2041 8.90625L1.2002 9.06543C1.2002 9.14467 1.20305 9.22752 1.20996 9.31445L1.21777 9.41211L1.20996 9.50977L1.2002 9.74316C1.20023 11.2514 2.42259 12.4744 3.93066 12.4746H12.0684C13.5297 12.4746 14.7226 11.3265 14.7959 9.88379L14.7998 9.74316C14.7998 8.78847 14.3094 7.94732 13.5605 7.45703L13.1377 7.17969L13.04 6.68262C12.6894 4.8834 11.104 3.52539 9.2041 3.52539ZM6.79688 6.74121C6.93478 6.61179 7.13694 6.57633 7.31055 6.65137C7.48407 6.72651 7.59654 6.89783 7.59668 7.08691V10.749C7.59642 11.0109 7.38396 11.2235 7.12207 11.2236C6.86013 11.2236 6.64772 11.0109 6.64746 10.749V8.18457L6.05859 8.73828C5.86754 8.91775 5.5662 8.90785 5.38672 8.7168C5.20757 8.52576 5.21736 8.2253 5.4082 8.0459L6.79688 6.74121ZM8.87793 6.6123C9.14003 6.61235 9.35254 6.82578 9.35254 7.08789V9.65137L9.94141 9.09863C10.1325 8.91917 10.4338 8.92809 10.6133 9.11914C10.7925 9.31017 10.7827 9.61061 10.5918 9.79004L9.20312 11.0947C9.0652 11.2242 8.86308 11.2596 8.68945 11.1846C8.51588 11.1094 8.40339 10.9382 8.40332 10.749V7.08789C8.40332 6.82582 8.61588 6.61241 8.87793 6.6123Z" fill="currentColor"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.8 KiB |
@ -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"
|
||||
|
||||
35
src/components/svg-icon/index.vue
Normal 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>
|
||||
|
||||
13
src/main.ts
@ -5,18 +5,25 @@
|
||||
import App from './App.vue';
|
||||
import router from './router';
|
||||
import store from './stores';
|
||||
import NoData from '@/components/no-data';
|
||||
import '@/api/index';
|
||||
|
||||
import NoData from '@/components/no-data';
|
||||
import SvgIcon from "@/components/svg-icon";
|
||||
|
||||
import '@/api/index';
|
||||
import '@arco-design/web-vue/dist/arco.css'; // Arco 默认样式
|
||||
import './core';
|
||||
|
||||
import 'normalize.css';
|
||||
import 'uno.css';
|
||||
import 'virtual:svg-icons-register'
|
||||
|
||||
// import '@/styles/vars.css'; // 优先加载
|
||||
|
||||
const app = createApp(App);
|
||||
|
||||
app.component('NoData', NoData);
|
||||
app.component('SvgIcon', SvgIcon);
|
||||
|
||||
app.use(store);
|
||||
app.use(router);
|
||||
app.component('NoData', NoData);
|
||||
app.mount('#app');
|
||||
|
||||
@ -5,10 +5,10 @@
|
||||
import type { AppRouteRecordRaw } from '../types';
|
||||
import { MENU_GROUP_IDS } from '@/router/constants';
|
||||
|
||||
import IconRepository from '@/assets/svg/icon-repository.svg';
|
||||
import IconMediaAccount from '@/assets/svg/icon-mediaAccount.svg';
|
||||
import IconPutAccount from '@/assets/svg/icon-putAccount.svg';
|
||||
import IconIntelligentSolution from '@/assets/svg/icon-intelligentSolution.svg';
|
||||
import IconRepository from '@/assets/svg/svg-repository.svg';
|
||||
import IconMediaAccount from '@/assets/svg/svg-mediaAccount.svg';
|
||||
import IconPutAccount from '@/assets/svg/svg-putAccount.svg';
|
||||
import IconIntelligentSolution from '@/assets/svg/svg-intelligentSolution.svg';
|
||||
|
||||
const COMPONENTS: AppRouteRecordRaw[] = [
|
||||
{
|
||||
|
||||