- 更新 utils/icon.ts 使用 CoiIcon 替代原有图标实现 - 重构 IconSelect 组件使用 CoiIcon 统一图标渲染 - 移除对 @iconify/vue 的直接依赖 - 简化图标组件创建逻辑
16 lines
306 B
TypeScript
16 lines
306 B
TypeScript
import CoiIcon from '@/components/common/CoiIcon.vue'
|
|
|
|
export function renderIcon(icon?: string, size?: number) {
|
|
if (!icon)
|
|
return
|
|
|
|
return () => createIcon(icon, size)
|
|
}
|
|
|
|
export function createIcon(icon?: string, size: number = 18) {
|
|
if (!icon)
|
|
return
|
|
|
|
return h(CoiIcon, { icon, size })
|
|
}
|