2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-04 06:47:20 +08:00
Files
panel/web/src/utils/common/icon.ts

14 lines
308 B
TypeScript

import { Icon } from '@iconify/vue'
import { NIcon } from 'naive-ui'
import { h } from 'vue'
interface Props {
size?: number
color?: string
class?: string
}
export function renderIcon(icon: string, props: Props = { size: 12 }) {
return () => h(NIcon, props, { default: () => h(Icon, { icon }) })
}