From c37d0ac7887a3451b8558fc4aa6c05ed3b0ef74f Mon Sep 17 00:00:00 2001 From: Soybean Date: Tue, 26 Jul 2022 20:55:37 +0800 Subject: [PATCH] =?UTF-8?q?fix(utils):=20=E4=BF=AE=E5=A4=8DiconifyRender?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/common/icon.ts | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/utils/common/icon.ts b/src/utils/common/icon.ts index 689d7748..d9862d61 100644 --- a/src/utils/common/icon.ts +++ b/src/utils/common/icon.ts @@ -7,15 +7,15 @@ import SvgIcon from '@/components/custom/SvgIcon.vue'; * 动态渲染iconify * @param icon - 图标名称 * @param color - 图标颜色 - * @param size - 图标大小 + * @param fontSize - 图标大小 */ -export function iconifyRender(icon: string, color?: string, size?: number) { - const style: { color?: string; size?: string } = {}; +export function iconifyRender(icon: string, color?: string, fontSize?: number) { + const style: { color?: string; fontSize?: string } = {}; if (color) { style.color = color; } - if (size) { - style.size = `${size}px`; + if (fontSize) { + style.fontSize = `${fontSize}px`; } 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 color - 图标颜色 - * @param size - 图标大小 + * @param fontSize - 图标大小 */ -export function customIconRender(icon: string, color?: string, size?: number) { - const style: { color?: string; size?: string } = {}; +export function customIconRender(icon: string, color?: string, fontSize?: number) { + const style: { color?: string; fontSize?: string } = {}; if (color) { style.color = color; } - if (size) { - style.size = `${size}px`; + if (fontSize) { + style.fontSize = `${fontSize}px`; } return () => h(NIcon, null, { default: () => h(SvgIcon, { icon, style }) });