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

fix(table): 修复可选中行table组件,data为空数据时,默认全选按钮会选中的问题 #1150

Closed

Conversation

hi-zhaoyeqing
Copy link
Contributor

修复可选中行table组件,data为空数据时,默认全选按钮会选中的问题

🤔 这个 PR 的性质是?

  • 日常 bug 修复
  • 新特性提交
  • 文档改进
  • 演示代码改进
  • 组件样式/交互改进
  • CI/CD 改进
  • 重构
  • 代码风格优化
  • 测试用例
  • 分支合并
  • 其他

🔗 相关 Issue

#1143

💡 需求背景和解决方案

image

修复后

image

原因 对空数据没进行判断 解决方案 对空数据做处理

📝 更新日志

  • fix(table): 修复可选中行table组件,data为空数据时,默认全选按钮会选中的问题

  • 本条 PR 不需要纳入 Changelog

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

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

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

@github-actions
Copy link
Contributor

github-actions bot commented Jul 11, 2022

完成

@@ -65,12 +65,14 @@ export default function useRowSelect(props: TdPrimaryTableProps) {

// eslint-disable-next-line
function getSelectedHeader(h: CreateElement) {
const isIndeterminate = intersectionKeys.value.length > 0 && intersectionKeys.value.length < canSelectedRows.value.length;
const isChecked = intersectionKeys.value.length
Copy link
Collaborator

@chaishi chaishi Jul 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checkbox 的参数 checked 数据类型是 boolean

当前的计算方式 可能出现 checked=0,不符合预期,需添加 Boolean 进行数据类型转换

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

好的,我修改下

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修改

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

运行 npm run test:update 后已提交

@xiaosansiji
Copy link
Collaborator

image

本地执行下 `npm run test:update` 更新一下 snapshot

@hi-zhaoyeqing hi-zhaoyeqing force-pushed the fix/table-select-all branch 3 times, most recently from 3fcf8c7 to abe8e83 Compare July 12, 2022 11:18
修复可选中行table组件,data为空数据时,默认全选按钮会选中的问题
@hi-zhaoyeqing hi-zhaoyeqing force-pushed the fix/table-select-all branch from abe8e83 to 8eab365 Compare July 12, 2022 11:31
@uyarn
Copy link
Collaborator

uyarn commented Jul 14, 2022

@chaishi 看起来和你的改动有冲突

@uyarn
Copy link
Collaborator

uyarn commented Jul 18, 2022

@qdzhaoxiaodao 别误会 应该是你提的时候刚好一直CI有问题 我们在CHANGELOG上说明一下

@uyarn
Copy link
Collaborator

uyarn commented Jul 18, 2022

@qdzhaoxiaodao #1172 看了一下其实PR有提到是同步你的代码的 然后我们CHANGELOG上补充下是by you
image

@PengYYYYY
Copy link
Collaborator

PengYYYYY commented Jul 18, 2022

而且,你们换个文案也行啊。 image

@qdzhaoxiaodao 不好意思,这个 PR 我提的,是 vue-next 的 pr 合掉了,这边顺手把vue这边处理了,我在 pr 里面有标注着这个 PR 的来源,后续此类修复会在PR合并的时候询问是否有修复 react 和 vue2 的意愿。

@hi-zhaoyeqing
Copy link
Contributor Author

了解

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.

5 participants