refactor: 重构图标使用方式,集成自定应图标

This commit is contained in:
张传龙
2022-06-19 13:35:36 +08:00
parent 00ba77c15e
commit f88b4f52a1
19 changed files with 79 additions and 144 deletions

View File

@@ -1,6 +1,7 @@
import { h } from 'vue'
import { Icon } from '@iconify/vue'
import { NIcon } from 'naive-ui'
export function renderIcon(icon, props = { size: 12 }) {
return () => h(NIcon, { ...props }, { default: () => h(icon) })
return () => h(NIcon, props, { default: () => h(Icon, { icon }) })
}