mirror of
https://github.com/jekip/naive-ui-admin.git
synced 2026-03-01 00:23:11 +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) {
|
export function renderIcon(icon) {
|
||||||
return () => h(NIcon, null, { default: () => h(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
|
* render new Tag
|
||||||
|
|||||||
Reference in New Issue
Block a user