Skip to content

Commit 6e38eb1

Browse files
authored
fix: support pluginPath svg file as component show list when dev mode (#1902)
1 parent 5d227d8 commit 6e38eb1

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Diff for: web/src/core/global.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,12 @@ const registerIcons = async(app) => {
3131
continue
3232
}
3333
const key = `${pluginName}${iconName}`
34-
const iconComponent = createIconComponent(iconName)
34+
// 开发模式下列出所有 svg 图标,方便开发者直接查找复制使用
35+
import.meta.env.MODE == 'development' && console.log(`svg-icon-component: <${key} />`)
36+
const iconComponent = createIconComponent(key)
3537
config.logs.push({
3638
'key': key,
37-
'label': iconName,
39+
'label': key,
3840
})
3941
app.component(key, iconComponent)
4042
}

Diff for: web/vite.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ export default ({
9494
}),
9595
vuePlugin(),
9696
svgBuilder('./src/assets/icons/'),
97+
svgBuilder('./src/plugin/'),
9798
[Banner(`\n Build based on gin-vue-admin \n Time : ${timestamp}`)],
9899
VueFilePathPlugin("./src/pathInfo.json")
99100
],

0 commit comments

Comments
 (0)