mirror of
https://github.com/m-xlsea/ruoyi-plus-soybean.git
synced 2025-09-23 23:39:47 +08:00
feat(projects): 新增自定义svg图标动态渲染
This commit is contained in:
@ -1,21 +0,0 @@
|
||||
import Icons from 'unplugin-icons/vite'; // iconify图标
|
||||
import IconsResolver from 'unplugin-icons/resolver';
|
||||
import Components from 'unplugin-vue-components/vite'; // 从指定目录自动导入组件
|
||||
import { FileSystemIconLoader } from 'unplugin-icons/loaders';
|
||||
|
||||
export default (srcPath: string) => {
|
||||
return [
|
||||
Icons({
|
||||
compiler: 'vue3',
|
||||
customCollections: {
|
||||
custom: FileSystemIconLoader(`${srcPath}/assets/svg`),
|
||||
},
|
||||
scale: 1,
|
||||
defaultClass: 'inline-block',
|
||||
}),
|
||||
Components({
|
||||
dts: true,
|
||||
resolvers: [IconsResolver({ customCollections: ['custom'], componentPrefix: 'icon' })],
|
||||
}),
|
||||
];
|
||||
};
|
Reference in New Issue
Block a user