-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* feat(check-tree-select): 新增支持过滤已选择项(#2951) * chore(check-tree-select): 生成变更记录文件 * chore: 修改类型和标题 --------- Co-authored-by: xiamiao <[email protected]>
- Loading branch information
1 parent
bc30652
commit f7137e3
Showing
5 changed files
with
184 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@hi-ui/check-tree-select": minor | ||
--- | ||
|
||
feat: 新增支持过滤已选择项 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@hi-ui/hiui": patch | ||
--- | ||
|
||
feat(check-tree-select): 新增支持过滤已选择项 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
102 changes: 102 additions & 0 deletions
102
packages/ui/check-tree-select/stories/only-checked.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
import React from 'react' | ||
import CheckTreeSelect from '../src' | ||
|
||
/** | ||
* @title 查看已选 | ||
*/ | ||
export const OnlyChecked = () => { | ||
const [data] = React.useState([ | ||
{ | ||
title: '手机类', | ||
id: '0', | ||
children: [ | ||
{ | ||
title: 'Redmi系列', | ||
id: '0-0', | ||
disabled: true, | ||
children: [ | ||
{ | ||
id: '0-0-1', | ||
title: 'Redmi K30', | ||
}, | ||
{ | ||
id: '0-0-2', | ||
title: 'Redmi K30 Pro', | ||
}, | ||
{ | ||
id: '0-0-3', | ||
title: 'Redmi 10X 5G', | ||
}, | ||
{ | ||
id: '0-0-4', | ||
title: 'Redmi Note 8', | ||
}, | ||
{ | ||
id: '0-0-5', | ||
title: 'Redmi 9', | ||
}, | ||
{ | ||
id: '0-0-6', | ||
title: 'Redmi 9A', | ||
}, | ||
], | ||
}, | ||
{ | ||
title: '小米手机', | ||
id: '0-1', | ||
children: [ | ||
{ | ||
id: '0-1-1', | ||
title: '小米10 Pro', | ||
}, | ||
{ | ||
id: '0-1-2', | ||
title: '小米10', | ||
}, | ||
{ | ||
id: '0-1-3', | ||
title: '小米10 青春版 5G', | ||
}, | ||
{ | ||
id: '0-1-4', | ||
title: '小米MIX Alpha', | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
{ | ||
title: '电视', | ||
id: '1', | ||
children: [ | ||
{ | ||
title: '小米电视 大师 65英寸OLED', | ||
id: '1-0', | ||
}, | ||
{ | ||
title: 'Redmi 智能电视 MAX 98', | ||
id: '1-1', | ||
}, | ||
{ | ||
title: '小米电视4A 60英寸', | ||
id: '1-2', | ||
}, | ||
], | ||
}, | ||
]) | ||
|
||
return ( | ||
<> | ||
<h1>Only Checked</h1> | ||
<div className="check-tree-select-only-checked__wrap"> | ||
<CheckTreeSelect | ||
style={{ width: 240 }} | ||
data={data} | ||
checkedMode="PARENT" | ||
onChange={console.log} | ||
showOnlyShowChecked | ||
/> | ||
</div> | ||
</> | ||
) | ||
} |