-
-
Notifications
You must be signed in to change notification settings - Fork 50.5k
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: table 组件 rowSelection 添加 defaultSelectedRowKeys 属性 #29879
Conversation
Codecov Report
@@ Coverage Diff @@
## feature #29879 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 397 397
Lines 7510 7509 -1
Branches 2112 2101 -11
=========================================
- Hits 7510 7509 -1
Continue to review full report at Codecov.
|
来个测试用例。 |
如何单独执行某个测试用例? |
可以在最后加文件夹路径,只执行某个组件的所有用例。 |
配合 it.only 或者 fit |
@afc163 已添加。 |
@@ -205,6 +205,7 @@ const columns = [ | |||
| preserveSelectedRowKeys | 当数据被删除时仍然保留选项的 `key` | boolean | - | 4.4.0 | | |||
| renderCell | 渲染勾选框,用法与 Column 的 `render` 相同 | function(checked, record, index, originNode) {} | - | 4.1.0 | | |||
| selectedRowKeys | 指定选中项的 key 数组,需要和 onChange 进行配合 | string\[] \| number\[] | \[] | | | |||
| defaultSelectedRowKeys | 默认选中项的 key 数组 | string\[] \| number\[] | \[] | | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
英文文档也需要修改。
🤔 This is a ...
🔗 Related issue link
💡 Background and solution
defaultSelectedRowKeys
属性可以让用户在不触碰 state 的情况下定义 table 组件 rowSelection 中的默认选中行。📝 Changelog
rowSelection.defaultSelectedRowKeys
.rowSelection.defaultSelectedRowKeys
支持。☑️ Self Check before Merge