🚧 增加 defaultProps 属性 #23
buuing
started this conversation in
需求 - Ideas
Replies: 1 comment
-
|
项目中使用的是ts, 我担心这样的话, 可能导致无法推断类型, 那这个`disabled作为变量时, 还是否能正确的推导吗 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
需求背景:
因为考虑到某些用户的数据可能是后端传递的
此时用户要想使用的话, 还得遍历所有树节点, 把
title改成text, 把items改成children, 咱们才能识别并渲染考虑到大部分的初级前端, 并不会遍历树结构, 也是为了提升组件的属性自由度, 打算增加
defaultProps属性功能描述
defaultProps属性与theme同级, 为对象类型, 并且只支持以下5个key的替换typetextdisabledcallbackchildren代码示例
Beta Was this translation helpful? Give feedback.
All reactions