amis icon indicating copy to clipboard operation
amis copied to clipboard

内置Icon组件当图片源为url时,className不能自定制

Open theojia opened this issue 5 years ago • 0 comments

src\renderers\Icon.tsx

render() {
    const {icon, vendor, classnames: cx, className} = this.props;

    const isURLIcon = icon?.indexOf('.') !== -1;
    return isURLIcon ? (
      <img className={cx('Icon')} src={icon} />
    ) : (
      <i
        className={cx(
          vendor === 'iconfont'
            ? `iconfont icon-${icon}`
            : `${vendor} ${vendor}-${icon}`,
          className
        )}
      />
    );
  }

为什么 isURLIcon 的情况下不支持className自定制呢?

theojia avatar Jul 06 '21 03:07 theojia