Skip to content

Commit

Permalink
Merge branch 'release' into feat/dragMove
Browse files Browse the repository at this point in the history
  • Loading branch information
pointhalo authored Dec 2, 2024
2 parents 96cd61f + 52b37b1 commit 8406c03
Show file tree
Hide file tree
Showing 730 changed files with 2,791 additions and 5,925 deletions.
58 changes: 58 additions & 0 deletions content/input/cascader/index-en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -1537,6 +1537,63 @@ import { Cascader } from '@douyinfe/semi-ui';
};
```
### Checked RelationShip
Version: >= 2.71.0
In multiple, `checkRelation` can be used to set the type of node selection relationship, optional: 'related' (default), 'unRelated'. When the selection relationship is 'unRelated', it means that selections between nodes do not affect each other.
```jsx live=true
import React from 'react';
import { Cascader } from '@douyinfe/semi-ui';
() => {
const treeData = [
{
label: 'Asia',
value: 'Asia',
key: '0',
children: [
{
label: 'China',
value: 'China',
key: '0-0',
children: [
{
label: 'Beijing',
value: 'Beijing',
key: '0-0-0',
},
{
label: 'Shanghai',
value: 'Shanghai',
key: '0-0-1',
},
],
},
],
},
{
label: 'North America',
value: 'North America',
key: '1',
}
];

return (
<Cascader
multiple
defaultValue={[
['Asia'],
['Asia', 'China', 'Beijing']
]}
checkRelation='unRelated'
style={{ width: 300 }}
treeData={treeData}
/>
);
};
```
### Dynamic Update of Data
```jsx live=true
Expand Down Expand Up @@ -1895,6 +1952,7 @@ function Demo() {
| borderless | borderless mode >=2.33.0 | boolean | |
| bottomSlot | bottom slot | ReactNode | - | 1.27.0 |
| changeOnSelect | Toggle whether non-leaf nodes are selectable | boolean | false | - |
| checkRelation | In multiple, the relationship between the checked states of the nodes, optional: 'related'、'unRelated'. | string | 'related' | v2.71.0 |
| className | ClassName | string | - | - |
| clearIcon | Can be used to customize the clear button, valid when showClear is true | ReactNode | - | 2.25.0 |
| defaultOpen | Set whether to open the dropDown by default | boolean | false | - |
Expand Down
51 changes: 51 additions & 0 deletions content/input/cascader/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -1516,6 +1516,56 @@ import { Cascader } from '@douyinfe/semi-ui';
};
```

### 节点选中关系

版本:>= 2.71.0

多选时,可以使用 `checkRelation` 来设置节点之间选中关系的类型,可选:'related'(默认)、'unRelated'。当选中关系为 'unRelated' 时,意味着节点之间的选中互不影响。

```jsx live=true
import React from 'react';
import { Cascader } from '@douyinfe/semi-ui';
() => {
const treeData = [
{
label: '亚洲',
value: 'Asia',
children: [
{
label: '中国',
value: 'China',
children: [
{
label: '北京',
value: 'Beijing',
},
{
label: '上海',
value: 'Shanghai',
},
],
},
],
},
{
label: '北美洲',
value: 'North America',
}
];
return (
<Cascader
multiple
defaultValue={[
['Asia'],
['Asia', 'China', 'Beijing']
]}
checkRelation='unRelated'
style={{ width: 300 }}
treeData={treeData}
/>
);
};
```

### 动态更新数据

Expand Down Expand Up @@ -1872,6 +1922,7 @@ function Demo() {
| bottomSlot | 底部插槽 | ReactNode | - | 1.27.0 |
| borderless | 无边框模式 >=2.33.0 | boolean | |
| changeOnSelect | 是否允许选择非叶子节点 | boolean | false | - |
| checkRelation | 多选时,节点之间选中状态的关系,可选:'related'、'unRelated'。 | string | 'related' | v2.71.0 |
| className | 选择框的 className 属性 | string | - | - |
| clearIcon | 可用于自定义清除按钮, showClear为true时有效 | ReactNode | - | 2.25.0 |
| defaultOpen | 设置是否默认打开下拉菜单 | boolean | false | - |
Expand Down
Loading

0 comments on commit 8406c03

Please sign in to comment.