mirror of
https://github.com/soybeanjs/soybean-admin.git
synced 2025-11-10 10:43:41 +08:00
fix(utils): 修复iconifyRender
This commit is contained in:
@@ -7,15 +7,15 @@ import SvgIcon from '@/components/custom/SvgIcon.vue';
|
|||||||
* 动态渲染iconify
|
* 动态渲染iconify
|
||||||
* @param icon - 图标名称
|
* @param icon - 图标名称
|
||||||
* @param color - 图标颜色
|
* @param color - 图标颜色
|
||||||
* @param size - 图标大小
|
* @param fontSize - 图标大小
|
||||||
*/
|
*/
|
||||||
export function iconifyRender(icon: string, color?: string, size?: number) {
|
export function iconifyRender(icon: string, color?: string, fontSize?: number) {
|
||||||
const style: { color?: string; size?: string } = {};
|
const style: { color?: string; fontSize?: string } = {};
|
||||||
if (color) {
|
if (color) {
|
||||||
style.color = color;
|
style.color = color;
|
||||||
}
|
}
|
||||||
if (size) {
|
if (fontSize) {
|
||||||
style.size = `${size}px`;
|
style.fontSize = `${fontSize}px`;
|
||||||
}
|
}
|
||||||
return () => h(NIcon, null, { default: () => h(Icon, { icon, style }) });
|
return () => h(NIcon, null, { default: () => h(Icon, { icon, style }) });
|
||||||
}
|
}
|
||||||
@@ -24,15 +24,15 @@ export function iconifyRender(icon: string, color?: string, size?: number) {
|
|||||||
* 动态渲染自定义图标
|
* 动态渲染自定义图标
|
||||||
* @param icon - 图标名称
|
* @param icon - 图标名称
|
||||||
* @param color - 图标颜色
|
* @param color - 图标颜色
|
||||||
* @param size - 图标大小
|
* @param fontSize - 图标大小
|
||||||
*/
|
*/
|
||||||
export function customIconRender(icon: string, color?: string, size?: number) {
|
export function customIconRender(icon: string, color?: string, fontSize?: number) {
|
||||||
const style: { color?: string; size?: string } = {};
|
const style: { color?: string; fontSize?: string } = {};
|
||||||
if (color) {
|
if (color) {
|
||||||
style.color = color;
|
style.color = color;
|
||||||
}
|
}
|
||||||
if (size) {
|
if (fontSize) {
|
||||||
style.size = `${size}px`;
|
style.fontSize = `${fontSize}px`;
|
||||||
}
|
}
|
||||||
|
|
||||||
return () => h(NIcon, null, { default: () => h(SvgIcon, { icon, style }) });
|
return () => h(NIcon, null, { default: () => h(SvgIcon, { icon, style }) });
|
||||||
|
|||||||
Reference in New Issue
Block a user