-
Notifications
You must be signed in to change notification settings - Fork 141
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
[comp: badge]: feature badge component #64
Comments
count的类型我们定义的是number和string;因此默认值给个特殊含义的number或者string会更为合理一些(而不是undefined),建议的话默认值给0;同时配合实现showZero的配置项体现其特殊含义;然后跟antd保持一致,如果是0默认不展示;类似的overflowCount可以给个默认值99,这个比较常见; slot的话;我不是很理解为什么要有custom项;内容一般是用户自己去插入的;如果整个badge都自定义了,那么为什么还要用我们的这个Bage呢;业务里直接自己封装一个简单的就是了;所以建议给个默认插槽就好了;custome暂时不做考虑 |
|
用户自定义内容的话,使用默认插槽就已经能实现了;例如: 我想你需要的也就是上面这三种使用方式;这个一个默认插槽处理就够了 |
badge的设计是一个wrapper包裹住需要添加badge内容的实现,解析出的DOM结构为 <span> // badge wrapper
content
<sup></sup> // 此处才为badge内容
</span> 所以,自定义badge内容需要具名实现 或者说有什么更好的实现建议呢,欢迎提出 |
了解,这样的话确实是应该有两个插槽,区分开来 |
*fix(comp:badge): fix slots reactive effect *feat(comp:badge): globalConfig support fix IDuxFE#64
*fix(comp:badge): fix slots reactive effect *feat(comp:badge): globalConfig support fix #64
徽标组件
What problem does this feature solve?
徽标组件
What does the proposed API look like?
API
dot
boolean
false
count
number|string
-
overflowCount
${overflowCount}+
显示number|string
99
showZero
boolean
false
color
hex|rgb?a
-
SLOTS
defalut
count
The text was updated successfully, but these errors were encountered: