fix(table): fix checkall button is disabled when reserveSelectedRowOnPaginate=false and request data async #4670
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
修复设置 reserveSelectedRowOnPaginate=false 时全选被禁用切换分页后才恢复正常并且无法全选的问题
🤔 这个 PR 的性质是?
🔗 相关 Issue
💡 需求背景和解决方案
问题:
修复后:
原因:
useRowSelect.tsx文件种全选复选框是否禁用的props是一个计算属性,reserveSelectedRowOnPaginate为false时返回currentPaginateData,由于初始化时定义currentPaginateData变量值为data.value,失去了对data的响应式控制,导致后续从远程获取到数据源之后,computed也没有监听到currentPaginateData的变化。
修复方案:
修改定义currentPaginateData为计算属性
关键代码:
📝 更新日志
fix(table): 修复异步请求数据下,
reserveSelectedRowOnPaginate
为false
时全选被禁用的缺陷本条 PR 不需要纳入 Changelog
☑️ 请求合并前的自查清单