king
2025-04-21 f3d4db769ba9b51b799d981511a710fd443d0e08
src/components/mk-icon/index.jsx
@@ -464,11 +464,28 @@
  render() {
    const { type, ...resProps } = this.props
    if (!type || !MkIcons[type]) return null
    if (!type) {
      return null
    } else if (MkIcons[type]) {
      return (
        MkIcons[type](resProps)
      )
    } else {
      let svg = type
    return (
      MkIcons[type](resProps)
    )
      if (!/<svg/.test(svg)) {
        try {
          svg = window.decodeURIComponent(window.atob(svg))
          if (!/<svg/.test(svg)) {
            svg = ''
          }
        } catch (e) {
          svg = ''
        }
      }
      return <span className={'anticon anticon-mk ' + (resProps.className || '')} style={resProps.style || null} dangerouslySetInnerHTML={{ __html: svg }}></span>
    }
  }
}
export default MkIcon