Skip to content
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

feat(Cascader): 添加禁用 #723

Merged
merged 711 commits into from
Mar 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
711 commits
Select commit Hold shift + click to select a range
b275766
chore: update workflows config.
jaywcjlove Feb 25, 2022
00f9443
chore: update workflows config.
jaywcjlove Feb 25, 2022
2b081f6
chore: update workflows config.
jaywcjlove Feb 25, 2022
b65d597
chore: update workflows config.
jaywcjlove Feb 25, 2022
3d2c38f
chore: update workflows config.
jaywcjlove Feb 25, 2022
1a3dad0
chore: update workflows config.
jaywcjlove Feb 25, 2022
51827fa
chore: update workflows config.
jaywcjlove Feb 25, 2022
526df26
chore: update workflows config.
jaywcjlove Feb 25, 2022
8ae9074
chore: update workflows config.
jaywcjlove Feb 25, 2022
448181e
chore: update workflows config.
jaywcjlove Feb 25, 2022
83144a8
chore: update workflows config.
jaywcjlove Feb 25, 2022
42022a1
chore: update workflows config.
jaywcjlove Feb 25, 2022
5c742b0
chore: update workflows config.
jaywcjlove Feb 25, 2022
e03e7fa
chore: update workflows config.
jaywcjlove Feb 25, 2022
ef264fc
chore: update workflows config.
jaywcjlove Feb 25, 2022
6ff5338
chore: update workflows config.
jaywcjlove Feb 25, 2022
c63a027
chore: update workflows config.
jaywcjlove Feb 25, 2022
c2193f6
chore: update workflows config.
jaywcjlove Feb 25, 2022
c0c77fe
chore: update workflows config.
jaywcjlove Feb 25, 2022
ffa2e85
chore: update workflows config.
jaywcjlove Feb 25, 2022
79087a3
chore: update workflows config.
jaywcjlove Feb 25, 2022
48ee2bd
chore: update workflows config.
jaywcjlove Feb 25, 2022
c61cb2c
chore: update workflows config.
jaywcjlove Feb 25, 2022
de00013
chore: update workflows config.
jaywcjlove Feb 25, 2022
e74dd79
chore: update workflows config.
jaywcjlove Feb 25, 2022
864ab0b
chore: update workflows config.
jaywcjlove Feb 25, 2022
b00bdab
chore: update workflows config.
jaywcjlove Feb 25, 2022
c9fac2c
chore: update workflows config.
jaywcjlove Feb 25, 2022
393d666
chore: update workflows config.
jaywcjlove Feb 25, 2022
0017aa8
chore: update workflows config.
jaywcjlove Feb 25, 2022
ca1a3e9
chore: update workflows config.
jaywcjlove Feb 25, 2022
dd90725
chore: update workflows config.
jaywcjlove Feb 25, 2022
b3633b0
chore: update workflows config.
jaywcjlove Feb 25, 2022
078f163
chore: update workflows config.
jaywcjlove Feb 25, 2022
6df14ea
chore: update workflows config.
jaywcjlove Feb 25, 2022
0dacb63
chore: update workflows config.
jaywcjlove Feb 25, 2022
9c19ecd
chore: update workflows config.
jaywcjlove Feb 25, 2022
16fc885
chore: update workflows config.
jaywcjlove Feb 25, 2022
f3e9efb
chore: update workflows config.
jaywcjlove Feb 25, 2022
2a02bc4
chore: update workflows config.
jaywcjlove Feb 25, 2022
d746c34
chore: update workflows config.
jaywcjlove Feb 25, 2022
d5d7bf3
chore: update workflows config.
jaywcjlove Feb 25, 2022
106334b
chore: update workflows config.
jaywcjlove Feb 25, 2022
b3b0d5a
chore: update workflows config.
jaywcjlove Feb 25, 2022
5ba8840
chore: update workflows config.
jaywcjlove Feb 25, 2022
73585a2
chore: update workflows config.
jaywcjlove Feb 25, 2022
eeb9c39
chore: update workflows config.
jaywcjlove Feb 25, 2022
16e733b
chore: update workflows config.
jaywcjlove Feb 25, 2022
d8d334c
chore: update workflows config.
jaywcjlove Feb 25, 2022
c618dba
chore: update workflows config.
jaywcjlove Feb 25, 2022
8c2fdae
chore: update workflows config.
jaywcjlove Feb 25, 2022
1372782
chore: update workflows config.
jaywcjlove Feb 25, 2022
52f790b
chore: update workflows config.
jaywcjlove Feb 25, 2022
829fe5c
chore: update workflows config.
jaywcjlove Feb 25, 2022
9febbff
chore: update workflows config.
jaywcjlove Feb 25, 2022
9794158
chore: update workflows config.
jaywcjlove Feb 25, 2022
6527dc0
chore: update workflows config.
jaywcjlove Feb 25, 2022
5717afe
chore: update workflows config.
jaywcjlove Feb 25, 2022
472113e
chore: update workflows config.
jaywcjlove Feb 25, 2022
7b018d6
chore: update workflows config.
jaywcjlove Feb 25, 2022
afdde71
chore: update workflows config.
jaywcjlove Feb 25, 2022
786359c
chore: update workflows config.
jaywcjlove Feb 25, 2022
0138376
chore: update workflows config.
jaywcjlove Feb 25, 2022
3234426
chore: update workflows config.
jaywcjlove Feb 25, 2022
73d6657
chore: update workflows config.
jaywcjlove Feb 25, 2022
94c52eb
chore: update workflows config.
jaywcjlove Feb 25, 2022
80491a2
chore: update workflows config.
jaywcjlove Feb 25, 2022
730b78b
chore: update workflows config.
jaywcjlove Feb 25, 2022
a88bbe5
chore: update workflows config.
jaywcjlove Feb 25, 2022
e08fbb1
chore: update workflows config.
jaywcjlove Feb 25, 2022
bd24886
chore: update workflows config.
jaywcjlove Feb 25, 2022
8a9e362
chore: update workflows config.
jaywcjlove Feb 25, 2022
994e832
chore: update workflows config.
jaywcjlove Feb 25, 2022
d24b155
chore: update workflows config.
jaywcjlove Feb 25, 2022
5ee5014
chore: update workflows config.
jaywcjlove Feb 25, 2022
00dd89b
chore: update workflows config.
jaywcjlove Feb 25, 2022
df83735
chore: update workflows config.
jaywcjlove Feb 25, 2022
a87cc46
chore: update workflows config.
jaywcjlove Feb 25, 2022
80db60e
chore: update workflows config.
jaywcjlove Feb 25, 2022
d4f12e2
chore: update workflows config.
jaywcjlove Feb 25, 2022
eec83cb
chore: update workflows config.
jaywcjlove Feb 25, 2022
05d95bd
chore: update workflows config.
jaywcjlove Feb 25, 2022
4bb2f80
chore: update workflows config.
jaywcjlove Feb 25, 2022
794742a
chore: update workflows config.
jaywcjlove Feb 25, 2022
6b2bdbb
chore: update workflows config.
jaywcjlove Feb 25, 2022
429cbc2
chore: update workflows config.
jaywcjlove Feb 25, 2022
2de0a60
chore: update workflows config.
jaywcjlove Feb 25, 2022
5646547
chore: update workflows config.
jaywcjlove Feb 25, 2022
0c31d44
chore: update workflows config.
jaywcjlove Feb 25, 2022
8f0d57a
chore: update workflows config.
jaywcjlove Feb 25, 2022
be4a1ef
chore: update workflows config.
jaywcjlove Feb 25, 2022
b0da4a8
chore: update workflows config.
jaywcjlove Feb 25, 2022
a0c451d
chore: update workflows config.
jaywcjlove Feb 25, 2022
1262f0c
chore: update workflows config.
jaywcjlove Feb 25, 2022
4fe82d3
chore: update workflows config.
jaywcjlove Feb 25, 2022
98f2466
chore: update workflows config.
jaywcjlove Feb 25, 2022
417e15c
chore: update workflows config.
jaywcjlove Feb 25, 2022
0579d7c
chore: update workflows config.
jaywcjlove Feb 25, 2022
7a91877
chore: update workflows config.
jaywcjlove Feb 25, 2022
f935e17
chore: update workflows config.
jaywcjlove Feb 25, 2022
7489e55
chore: update workflows config.
jaywcjlove Feb 25, 2022
70b1822
chore: update workflows config.
jaywcjlove Feb 25, 2022
6bbcca7
chore: update workflows config.
jaywcjlove Feb 25, 2022
f831b66
chore: update workflows config.
jaywcjlove Feb 25, 2022
9ef151d
chore: update workflows config.
jaywcjlove Feb 25, 2022
6c55d40
chore: update workflows config.
jaywcjlove Feb 25, 2022
2723b9e
chore: update workflows config.
jaywcjlove Feb 25, 2022
a878dc4
chore: update workflows config.
jaywcjlove Feb 25, 2022
ef0a14e
chore: update workflows config.
jaywcjlove Feb 25, 2022
83f4038
chore: update workflows config.
jaywcjlove Feb 25, 2022
b10d4c0
chore: update workflows config.
jaywcjlove Feb 25, 2022
231b12f
chore: update workflows config.
jaywcjlove Feb 25, 2022
fb347fb
chore: update workflows config.
jaywcjlove Feb 25, 2022
76fa6b8
chore: update workflows config.
jaywcjlove Feb 25, 2022
c80a5f5
chore: update workflows config.
jaywcjlove Feb 25, 2022
60e6943
chore: update workflows config.
jaywcjlove Feb 25, 2022
4b90347
chore: update workflows config.
jaywcjlove Feb 25, 2022
fdd5ef5
chore: update workflows config.
jaywcjlove Feb 25, 2022
86e52a2
chore: update workflows config.
jaywcjlove Feb 25, 2022
5514810
chore: update workflows config.
jaywcjlove Feb 25, 2022
2943c9c
docs(SearchTree): 文档整理
nullptr-z Mar 2, 2022
4a0d5e9
doc(Tag): 修复文档示例错误 (#599)
gssggssg Mar 3, 2022
1a32f2c
Revert "doc(Tag): 修复文档示例错误 (#599)" (#600)
jaywcjlove Mar 3, 2022
f9c79d0
doc(Tag): 修复文档示例错误 (#599)
gssggssg Mar 3, 2022
1bca790
Revert "doc(Tag): 修复文档示例错误 (#599)" (#600)
jaywcjlove Mar 3, 2022
34558b5
暂存
nullptr-z Mar 3, 2022
a54ba32
clean:无效代码
nullptr-z Mar 4, 2022
f2cbada
feat(Tabs): 选项卡过多,超过宽度时,收缩超出部分 #559 (#626)
nullptr-z Mar 8, 2022
58f0273
fix(SearchTree): 修复数字key为0导致无法选中问题
nullptr-z Mar 8, 2022
31d7d3e
fix(Drawer): 修复层级问题,Dropdown被遮挡 #620
nullptr-z Mar 8, 2022
a879cfd
revert:撤销
nullptr-z Mar 8, 2022
d342a3a
fix(Drawer): 修复层级问题,Dropdown被遮挡 #620
nullptr-z Mar 8, 2022
0188387
feat(SearchTree): 操作流程优化 #629 #631
nullptr-z Mar 8, 2022
f8826bd
chore(Form): Select 跟Input 在表单中使用,错误样式统一 #622 (#628)
cuilanxin Mar 8, 2022
11ba558
Merge branch 'master' of github.com:nullptr-z/uiw
nullptr-z Mar 8, 2022
fd0a096
fix react-search-tree: remove remark
nullptr-z Mar 8, 2022
2abc44b
merge code & fix conflict
nullptr-z Mar 8, 2022
d1d871c
style(Tabs): 收缩菜单优化
nullptr-z Mar 9, 2022
93c7d8b
Merge branch 'master' of github.com:uiwjs/uiw
nullptr-z Mar 9, 2022
e4ca65a
clean:删除调试代码
nullptr-z Mar 9, 2022
a0729dd
chore: 更改'提交问题'链接地址
nullptr-z Mar 9, 2022
7b2322e
Merge branch 'master' of github.com:uiwjs/uiw
nullptr-z Mar 9, 2022
5310ac1
fix(SearchSelect): 修复单选模式无法显示初始lable问题 & 文档补全
nullptr-z Mar 9, 2022
b4fbc94
feat(SearchSelect): 和SearchTree统一操作流程
nullptr-z Mar 9, 2022
68ff63b
Merge branch 'master' of github.com:uiwjs/uiw
nullptr-z Mar 9, 2022
ffdac73
fix(SearchSelect): 修复单选模式无法显示初始lable问题 & 文档补全
nullptr-z Mar 9, 2022
c23780d
feat(SearchSelect): 和SearchTree统一操作流程
nullptr-z Mar 9, 2022
8fabe48
Merge branch 'master' of github.com:nullptr-z/uiw
nullptr-z Mar 9, 2022
65bbf59
docs(FileInput): 补全示例文档 #642
nullptr-z Mar 9, 2022
cfb7aa3
Merge branch 'master' of github.com:uiwjs/uiw
nullptr-z Mar 9, 2022
3e24b03
fix(SearchTree): 修复数字key无法被选中问题&增加示例文档
nullptr-z Mar 9, 2022
a37997c
Merge branch 'master' of github.com:uiwjs/uiw
nullptr-z Mar 9, 2022
c90aab2
fix(SearchTree): 修复数字key无法被选中问题&增加示例文档
nullptr-z Mar 9, 2022
9fabded
Merge branch 'master' of github.com:nullptr-z/uiw
nullptr-z Mar 9, 2022
fa49290
fix(Tree): 节点key为0时children无法渲染 #619
nullptr-z Mar 9, 2022
f94765b
style(Progress): 进度起始和末尾圆角溢出
nullptr-z Mar 10, 2022
51b8570
Merge branch 'master' of github.com:uiwjs/uiw
nullptr-z Mar 9, 2022
1c74dd2
Merge branch 'master' of github.com:nullptr-z/uiw
nullptr-z Mar 9, 2022
2484e75
style(Progress): 进度起始和末尾圆角溢出
nullptr-z Mar 10, 2022
902ddf3
Merge branch 'master' of github.com:nullptr-z/uiw
nullptr-z Mar 10, 2022
2f6bbd9
fix(SearchSelect): 清空操作不再展开下拉选项&文档补全
nullptr-z Mar 10, 2022
bdf16c5
Merge branch 'master' of github.com:uiwjs/uiw
nullptr-z Mar 9, 2022
3cca5d2
Merge branch 'master' of github.com:nullptr-z/uiw
nullptr-z Mar 9, 2022
63b25e6
Merge branch 'master' of github.com:nullptr-z/uiw
nullptr-z Mar 10, 2022
8c22baf
fix(SearchSelect): 清空操作不再展开下拉选项&文档补全
nullptr-z Mar 10, 2022
8ffee07
Merge branch 'master' of github.com:nullptr-z/uiw
nullptr-z Mar 10, 2022
978175a
fix(Popover): 修复children为Icon弹窗无法准确定位问题 #639
nullptr-z Mar 10, 2022
2e7ad2b
fix:处理冲突
nullptr-z Mar 10, 2022
b6f61a4
Merge branch 'master' of github.com:nullptr-z/uiw into HEAD
nullptr-z Mar 10, 2022
af445d6
docs(Popover): 文档格式化
nullptr-z Mar 10, 2022
ec8b990
fix: 处理冲突
nullptr-z Mar 10, 2022
b8142e0
fix(SearchSelect): 修复form在没有initValue情况默认赋值了空字符串问题
nullptr-z Mar 10, 2022
490c716
feat(Transfer): 增加双栏穿梭选择框
nullptr-z Mar 15, 2022
84709e7
fix:处理冲突
nullptr-z Mar 15, 2022
3554a37
暂存
nullptr-z Mar 15, 2022
4dcb812
feat(Transfer): 增加选项搜索功能
nullptr-z Mar 15, 2022
0998fd1
fix:处理冲突
nullptr-z Mar 15, 2022
041c331
chore: 依赖撤销
nullptr-z Mar 15, 2022
ff1791f
chore:transfer组件发布
nullptr-z Mar 16, 2022
9ed78ee
Merge branch 'master' of github.com:uiwjs/uiw
nullptr-z Mar 16, 2022
2a983cb
fix(Transfer): 选项为多层tree时总数统计错误
nullptr-z Mar 16, 2022
d2f7963
Merge branch 'master' of github.com:uiwjs/uiw
nullptr-z Mar 16, 2022
4d860c3
docs(Transfer): 文档与菜单统一名称
nullptr-z Mar 16, 2022
9fe6b31
Merge branch 'master' of github.com:uiwjs/uiw
nullptr-z Mar 16, 2022
cb67596
docs(Steps):示例文档错误
nullptr-z Mar 16, 2022
21475b4
Merge branch 'master' of github.com:uiwjs/uiw
nullptr-z Mar 16, 2022
55516d0
style(Transfer): 添加穿梭箭头边框样式
nullptr-z Mar 16, 2022
6984731
Merge branch 'master' of github.com:uiwjs/uiw
nullptr-z Mar 16, 2022
12851d6
feat(Transfer): 增加选项栏全选功能
nullptr-z Mar 16, 2022
01196dc
fix:处理冲突冲突
nullptr-z Mar 16, 2022
e989aa1
style:样式调整
nullptr-z Mar 16, 2022
68b17b0
faeat(Transfer): 添加Tree节点多选支持
nullptr-z Mar 16, 2022
3ccfbf1
fix:处理冲突
nullptr-z Mar 16, 2022
ded38f2
style(Transfer): 添加选中样式
nullptr-z Mar 17, 2022
d2e2584
fix(Transfer): 潜在bug
nullptr-z Mar 17, 2022
2324def
fix(Transfer): 修复潜在BUG
nullptr-z Mar 17, 2022
837de85
fix:处理冲突
nullptr-z Mar 17, 2022
4b39e45
style(Tree): Tree没有子节点时展开箭头不再占位 #641
nullptr-z Mar 17, 2022
0bb7798
Merge branch 'master' of github.com:uiwjs/uiw
nullptr-z Mar 17, 2022
fa39f42
fix(Tree): 被隐藏(hideNode)的子节点,勾选父节点时,不再选中
nullptr-z Mar 17, 2022
9684814
Merge branch 'master' of github.com:uiwjs/uiw
nullptr-z Mar 17, 2022
e27fbe6
fix(Transfer): 修复Map对象引用拷贝导致的BUG
nullptr-z Mar 17, 2022
66f57a1
fix:处理冲突
nullptr-z Mar 17, 2022
946c721
fix(SearchSelect): 样式调整 #652
nullptr-z Mar 18, 2022
8a029f5
Merge branch 'master' of github.com:uiwjs/uiw
nullptr-z Mar 18, 2022
f43c041
faeat(Carousel): 增加走马灯组件Carousel
nullptr-z Mar 18, 2022
c96af8b
clean:删除多余包引用
nullptr-z Mar 18, 2022
882160f
Merge branch 'master' of github.com:uiwjs/uiw
nullptr-z Mar 18, 2022
ba90c6c
chore: 添加发布代码
nullptr-z Mar 18, 2022
e3dcb66
fix: 代码格式调整
nullptr-z Mar 18, 2022
0e908fa
docs: 文字描述错误
nullptr-z Mar 18, 2022
b67eee3
fix(SearchSelect): 修复禁用后任然可以删除问题
nullptr-z Mar 21, 2022
4f9cc27
fix:处理冲突
nullptr-z Mar 21, 2022
789627a
feat(Carousel):滚动效果总是从左向右滚动
nullptr-z Mar 21, 2022
b6cc5cf
Merge branch 'master' of github.com:uiwjs/uiw
nullptr-z Mar 21, 2022
0b0eff8
docs:描述错误
nullptr-z Mar 21, 2022
3e0e6dc
fix(Carousel): 添加ref类型
nullptr-z Mar 21, 2022
c4ac249
fix(SearchTree): 修复禁用后可以删问题
nullptr-z Mar 22, 2022
b7d266b
Merge branch 'master' of github.com:uiwjs/uiw
nullptr-z Mar 22, 2022
6bf560f
fix(FileInput): 隐藏原生input file提示文字 #700
nullptr-z Mar 22, 2022
7707bf5
Merge branch 'master' of github.com:uiwjs/uiw
nullptr-z Mar 22, 2022
eda1a89
Merge branch 'master' of github.com:uiwjs/uiw
nullptr-z Mar 22, 2022
cbf5255
fix(Popover): children为Icon定位错误问题
nullptr-z Mar 22, 2022
4f95542
feat(Carousel): 增加竖向滚动功能
nullptr-z Mar 22, 2022
4aa0396
Merge branch 'master' of github.com:uiwjs/uiw
nullptr-z Mar 22, 2022
4d5ee85
upd(DateInput): 添加autoClose自动隐藏弹层API #660
nullptr-z Mar 23, 2022
e532f2c
Merge branch 'master' of github.com:uiwjs/uiw
nullptr-z Mar 23, 2022
366de80
fix(Descriptions): 非中文不会自动换行
nullptr-z Mar 24, 2022
b97d172
Merge branch 'master' of github.com:uiwjs/uiw
nullptr-z Mar 24, 2022
1fddfa5
feat(Cascader): 增加级联选择框
nullptr-z Mar 24, 2022
53617db
Merge branch 'master' of github.com:uiwjs/uiw
nullptr-z Mar 24, 2022
662c7f1
upd(Cascader): 添加表单支持
nullptr-z Mar 25, 2022
9a92b6e
upd(Cascader): 增加清除按钮
nullptr-z Mar 25, 2022
751aae1
upd(Cascader): 增加清除按钮
nullptr-z Mar 25, 2022
24a3078
style: 统一清除按钮样式
nullptr-z Mar 25, 2022
5d476b3
fix: 处理冲突
nullptr-z Mar 25, 2022
7d536c7
fix(Cascader): 关闭按钮始终占用宽度问题
nullptr-z Mar 25, 2022
8979e88
feat(Cascader): 添加搜索功能
nullptr-z Mar 25, 2022
e480f50
fix: 处理冲突
nullptr-z Mar 25, 2022
68ac5cd
fix(Cascader): 空值 处理
nullptr-z Mar 25, 2022
296bcb8
fix(Menu): 默认展开Icon箭头方向错误 #712
nullptr-z Mar 28, 2022
9c950d3
Merge branch 'master' of github.com:uiwjs/uiw
nullptr-z Mar 28, 2022
c1177e4
style(Descriptions): 修复Item的 label不会自动换行
nullptr-z Mar 28, 2022
7d086f5
Merge branch 'master' of github.com:uiwjs/uiw
nullptr-z Mar 28, 2022
5b74ca1
feat(SearchTree): 增加valueAmount参数限制最大value长度
nullptr-z Mar 29, 2022
a82f833
clean: 清理调试代码
nullptr-z Mar 29, 2022
1721279
Merge branch 'master' of github.com:uiwjs/uiw
nullptr-z Mar 29, 2022
cdda1ba
feat(Cascader): 添加禁用
nullptr-z Mar 29, 2022
aba0a30
Merge branch 'master' of github.com:uiwjs/uiw
nullptr-z Mar 29, 2022
9a1a29e
style(Cascader):样式优化
nullptr-z Mar 29, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 34 additions & 20 deletions packages/react-cascader/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Cascader 级联选择
级联选择框。v4.16.0中添加

```jsx
import { Cascader } from 'uiw';
import { Cascader, Row, Col } from 'uiw';
// or
import Cascader from '@uiw/react-cascader';
```
Expand Down Expand Up @@ -56,15 +56,29 @@ const Demo = () => {
];

return (
<div style={{ width: 200 }}>
< Cascader
allowClear={true}
placeholder="请选择"
value={[1, 4, 7]}
option={options}
onChange={(value, seleteds) => console.log(value, seleteds)}
/>
</div>
<Row>
<Row>
<Cascader
style={{ width:200 }}
allowClear={true}
placeholder="请选择"
value={[1, 4, 7]}
option={options}
onChange={(value, seleteds) => console.log(value, seleteds)}
/>
</Row>
<Row style={{ marginLeft: 20 }}>
<Cascader
style={{ width:200 }}
allowClear={true}
placeholder="请选择"
value={[1, 4, 7]}
disabled={true}
option={options}
onChange={(value, seleteds) => console.log(value, seleteds)}
/>
</Row>
</Row>
)
};
ReactDOM.render(<Demo />, _mount_);
Expand Down Expand Up @@ -113,16 +127,15 @@ const Demo = () => {
];

return (
<div style={{ width: 200 }}>
<Cascader
allowClear={true}
placeholder="请选择"
value={[1, 4, 7]}
option={options}
onChange={(value, seleteds) => console.log(value, seleteds)}
onSearch={(text)=> console.log('text', text)}
/>
</div>
<Cascader
style={{ width: 200 }}
allowClear={true}
placeholder="请选择"
value={[1, 4, 7]}
option={options}
onChange={(value, seleteds) => console.log(value, seleteds)}
onSearch={(text)=> console.log('text', text)}
/>
)
};
ReactDOM.render(<Demo />, _mount_);
Expand Down Expand Up @@ -244,6 +257,7 @@ ReactDOM.render(<Demo />, _mount_);
| 参数 | 说明 | 类型 | 默认值 | 版本 |
| ---- | ---- | ---- | ---- | ---- |
| allowClear | 支持清除 | Boolean | `false` | - |
| disabled | 禁用选择器 | Boolean | `false` | - |
| placeholder | 选择框默认文字 | String | - | - |
| option | 选项菜单 | { value: String \| Number, label: React.ReactNode, children: Array<String \| Number>} | - | - |
| value | 指定当前选中的条目,多选时为一个数组 | String[] \| Number[] | - | - |
Expand Down
8 changes: 6 additions & 2 deletions packages/react-cascader/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export interface CascaderProps extends IProps, DropdownProps {
onSearch?: boolean | ((searchText: string) => void);
allowClear?: boolean;
placeholder?: string;
disabled?: boolean;
}

function Cascader(props: CascaderProps) {
Expand All @@ -25,6 +26,7 @@ function Cascader(props: CascaderProps) {
onChange,
onSearch,

disabled,
allowClear,
placeholder,
prefixCls = 'w-cascader',
Expand Down Expand Up @@ -131,7 +133,7 @@ function Cascader(props: CascaderProps) {
onSearch && handelSearch(value);
};

const widths = (style?.width as number) * 0.5 || undefined;
const widths = (style?.width as number) * 0.7 || undefined;

const OptionIter = (option: Array<OptionType>, level: number = 0) => {
if (!option) return;
Expand Down Expand Up @@ -178,6 +180,7 @@ function Cascader(props: CascaderProps) {
trigger="click"
style={{ marginTop: 5, ...style }}
overlayStyl={{ width: 100 }}
disabled={disabled}
{...others}
onVisibleChange={onVisibleChange}
isOpen={innerIsOpen}
Expand Down Expand Up @@ -225,14 +228,15 @@ function Cascader(props: CascaderProps) {
<Input
value={searchOn ? searchText : inputValue}
onChange={inputChange}
disabled={disabled}
placeholder={searchOn ? inputValue : placeholder}
style={{ width: style?.width }}
onFocus={() => onSearch && setSearchOn(true)}
onBlur={() => onSearch && setSearchOn(false)}
readOnly={!onSearch}
addonAfter={
<span style={{ width: 'auto' }}>
{selectIconType === 'close' && (
{!disabled && selectIconType === 'close' && (
<Icon type={selectIconType} onClick={onClear} className={`${prefixCls}-close`} />
)}
</span>
Expand Down