From 0ba276caaffedaf757b932f26aac86f695008175 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 28 十一月 2022 17:34:50 +0800 Subject: [PATCH] 2022-11-28 --- src/components/mk-icon/index.jsx | 14 +++++++++----- 1 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/components/mk-icon/index.jsx b/src/components/mk-icon/index.jsx index 9fff348..bb8a2ee 100644 --- a/src/components/mk-icon/index.jsx +++ b/src/components/mk-icon/index.jsx @@ -464,11 +464,15 @@ render() { const { type, ...resProps } = this.props - if (!type || !MkIcons[type]) return null - - return ( - MkIcons[type](resProps) - ) + if (!type) { + return null + } else if (MkIcons[type]) { + return ( + MkIcons[type](resProps) + ) + } else { + return <span className={'anticon ' + (resProps.className || '')} style={resProps.style || null} dangerouslySetInnerHTML={{ __html: type }}></span> + } } } export default MkIcon \ No newline at end of file -- Gitblit v1.8.0