feat: 封装renderIcon方法

This commit is contained in:
张传龙 2022-04-23 19:09:06 +08:00
parent b2cf78b36d
commit a6f86ee315

6
src/utils/icon.js Normal file
View File

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