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): fix table add resizable, turn page no save width #2575

Closed
wants to merge 4 commits into from

Conversation

HaixingOoO
Copy link
Collaborator

🤔 这个 PR 的性质是?

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

🔗 相关 Issue

💡 需求背景和解决方案

Table组件,resizable开启后,翻页之后各列宽度未能保存。
使用useMemo来优化columns。

📝 更新日志

  • fix(table): 修复表格组件,可调整大小开启后,翻页之后各列宽度未能保存。

  • 本条 PR 不需要纳入 Changelog

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

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

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

Copy link
Contributor

github-actions bot commented Nov 1, 2023

完成

const cols = getColumns(columns);
if (showExpandIconColumn) {
cols.unshift(getExpandColumn());
}
return cols;
})();
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [columns, showExpandIconColumn]);
Copy link
Collaborator

@chaishi chaishi Nov 2, 2023

Choose a reason for hiding this comment

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

此处需添加 getColumns 中的更多依赖,如: tDisplayColumns props.columnController props.showSortColumnBgColor props.sort primaryTableRef.current?.tableContentRef 等等,可能需要再仔细确认下

方便的话,验证一下列配置、表头吸顶、虚拟滚动等场景是否正常

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ok,我验证一下。

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

image
外层太多影响Columns的,不好解决这个依赖的问题,要么导出个重置宽度的事件,这图里的注释掉,让用户自己处理要不要重置宽度是不是好点?

Copy link
Collaborator

Choose a reason for hiding this comment

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

可以,我试试在分页触发的时候读取保存好的宽度

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

可以,我试试在分页触发的时候读取保存好的宽度

那你解决了,后面把我这个PR关闭就好

@HaixingOoO HaixingOoO closed this Jan 19, 2024
@HaixingOoO HaixingOoO deleted the fix/table/resizable branch January 19, 2024 06:02
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.

2 participants