-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
图标(Icon)解决方案 #3563
Comments
方案参考:
对于开发者来说使用的都是从 Fusion/antd 里导出的 |
非常期待这个功能早日落地,目前我使用以下方式使用额外的icon,但是icon样式比较难控制 const CustomIcon = Icon.createFromIconfontCN({ |
@imsobear @we6288815 请教下 iconfont的svg js链接怎么生成的?我想引入外部icon但是找不到对应的url |
@jacktang 我是把图标加入到项目里面生成的 |
@we6288815 多谢 解决了 👍 |
https://iconify.design/ 基于这个方案貌似不错 |
希望能够采用该方案 |
@imsobear 类似于这样? Usageimport { Icon, addIconSet } from 'ice'
// 自定义 icon
addIconSet('cos', {
'account-box': {
body: '<path />'
},
'home': {
body: '<path />'
}
})
function FC() {
return (
<>
<Icon type="cos:home" style={{ width: 25, height: 25 }} />
<Icon type="icon:home" style={{ width: 25, height: 25 }} />
</>
)
} Decs默认添加 https://ant.design/components/icon-cn 的资源,引用时: Icon 组件收集所有 type,然后进行分析并远程拉取内部定义的资源 |
这个功能什么时候能落地?都等了一两年了…… |
Vite 模式的话可以直接用 unocss 来实现,参考:#4864 (comment) ,unocss 貌似已经支持 webpack 模式了,不过我目前还没有测试过。 |
ok,我看看 |
Do you want to request a feature or report a bug?
feature
What is the current behavior?
icon 比较少
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.
build.json
:src/app.(ts|js)
:What is the expected behavior?
The text was updated successfully, but these errors were encountered: