mirror of
https://github.com/jekip/naive-ui-admin.git
synced 2026-02-04 13:42:27 +08:00
Merge pull request #195 from 15982650876/feat/shark
feat:add 增加了菜单font图标的适配
This commit is contained in:
@@ -10,6 +10,28 @@ import { cloneDeep } from 'lodash-es';
|
||||
export function renderIcon(icon) {
|
||||
return () => h(NIcon, null, { default: () => h(icon) });
|
||||
}
|
||||
/**
|
||||
* font 图标(Font class)
|
||||
* */
|
||||
export function renderFontClassIcon(icon: string, iconName = 'iconfont') {
|
||||
return () => h('span', { class: [iconName, icon] });
|
||||
}
|
||||
/**
|
||||
* font 图标(Unicode)
|
||||
* */
|
||||
export function renderUnicodeIcon(icon: string, iconName = 'iconfont') {
|
||||
return () => h('span', { class: [iconName], innerHTML: icon });
|
||||
}
|
||||
/**
|
||||
* font svg 图标
|
||||
* */
|
||||
export function renderfontsvg(icon) {
|
||||
return () =>
|
||||
h(NIcon, null, {
|
||||
default: () =>
|
||||
h('svg', { class: `icon`, 'aria-hidden': 'true' }, h('use', { 'xlink:href': `#${icon}` })),
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* render new Tag
|
||||
|
||||
Reference in New Issue
Block a user