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: useAntdTableSelection #2477

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

raotaohub
Copy link

@raotaohub raotaohub commented Feb 13, 2024

[English Template / 英文模板]

🤔 管理 Antd Table rowSelection 相关状态以及操作的 hook

  • ☑️ 新特性提交
  • 日常 bug 修复
  • 站点、文档改进
  • 演示代码改进
  • TypeScript 定义更新
  • 包体积优化
  • 性能优化
  • 功能增强
  • 国际化改进
  • 重构
  • 代码风格优化
  • 测试用例
  • 分支合并
  • 其他改动(是关于什么的改动?)

🔗 相关 Issue

#2471

💡 需求背景和解决方案

场景:使用 Antd Table 组件时,需要更灵活的selection操作
方案:通过接管Antd Table rowSeletion的 selectedRowKeys/ disabled/ rowKey/ type/ onChange / getCheckboxProps 等几项关键属性,实现一系列多选单选操作,及相关状态的获取。
演示:Issue
#2471 (comment)

📝 更新日志

新增 useAntdTableSelection , 它会自动管理 Table 可选项数据,内置了常用的全选、单选、toogle 等。

语言 更新描述
🇺🇸 英文 new featrue useAntdTableSelection
🇨🇳 中文 新功能 useAntdTableSelection

☑️ 请求合并前的自查清单

⚠️ 请自检并全部勾选全部选项⚠️

  • ☑️ 文档已补充或无须补充
  • ☑️ 代码演示已提供或无须提供
  • ☑️ TypeScript 定义已补充或无须补充
  • ☑️ Changelog 已提供或无须提供

@CLAassistant
Copy link

CLAassistant commented Feb 13, 2024

CLA assistant check
All committers have signed the CLA.

@raotaohub
Copy link
Author

Antd Table 点击row的回调onCell ,args[1] 为 index ,因此rowKey的函数 args[1] 也要支持 index

@raotaohub raotaohub force-pushed the master branch 2 times, most recently from 48bebdd to 514df66 Compare March 28, 2024 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants