mirror of
https://github.com/m-xlsea/ruoyi-plus-soybean.git
synced 2025-09-24 07:49:47 +08:00
feat(projects): 添加SvgIcon,配置vite plugin
This commit is contained in:
@ -16,6 +16,15 @@
|
||||
<web-site-link label="iconify地址:" link="https://icones.js.org/" class="mt-10px" />
|
||||
</template>
|
||||
</n-card>
|
||||
<n-card title="SvgIcon 示例" class="mt-10px shadow-sm rounded-16px">
|
||||
<div class="grid grid-cols-10">
|
||||
<template v-for="item in svgIcons" :key="item">
|
||||
<div class="mt-5px flex-x-center">
|
||||
<svg-icon :name="item" />
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</n-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -24,6 +33,7 @@ import { ref } from 'vue';
|
||||
import { Icon } from '@iconify/vue';
|
||||
import { IconSelect, WebSiteLink } from '@/components';
|
||||
import { icons } from './icons';
|
||||
import { svgIcons } from './svg-icons';
|
||||
|
||||
const selectVal = ref('');
|
||||
</script>
|
||||
|
4
src/views/plugin/icon/svg-icons.ts
Normal file
4
src/views/plugin/icon/svg-icons.ts
Normal file
@ -0,0 +1,4 @@
|
||||
const importSvgIcons = import.meta.glob('../../../assets/svg/**/*.svg');
|
||||
export const svgIcons = Object.keys(importSvgIcons).map(k => {
|
||||
return k.split('/svg/')[1].replaceAll('/', '-').replace('.svg', '');
|
||||
});
|
Reference in New Issue
Block a user