amis
amis copied to clipboard
内置Icon组件当图片源为url时,className不能自定制
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自定制呢?