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

columns副作用 #78

Closed
candy4290 opened this issue Feb 2, 2024 · 4 comments
Closed

columns副作用 #78

candy4290 opened this issue Feb 2, 2024 · 4 comments

Comments

@candy4290
Copy link

通过memo包裹,利用columns的副作用。如果此时,我自己实现重置列宽的方法,能否通过将columns中每一项的width更新,达到重置列宽的需求?目前发现这样做,没有效果。求助~

@hemengke1997
Copy link
Owner

有提供 resetColumns 方法来重置列宽

@candy4290
Copy link
Author

candy4290 commented Feb 4, 2024

有提供 resetColumns 方法来重置列宽
首先谢谢作者大大,很好用,节约了大把时间。
我这边使用缓存来持久化,发现我调整后,刷新整个页面。这时候调用这个函数是无法重置到最初状态的。我需要重置到最开始进入页面的列宽~~~
所以就想着试试利用副作用能否达到效果。
作者大大帮忙看下,虽然我现在通过一些旁门左道也实现了这个功能,但是写的太绕了~~~

@hemengke1997
Copy link
Owner

我没理解到你的需求,麻烦你理一下 重新描述哈

@candy4290
Copy link
Author

我没理解到你的需求,麻烦你理一下 重新描述哈
假设最开始列宽状态为A。调整列宽,且通过配置columnsState持久化。问题是我调整列宽后,F5刷新页面,此时调用resetColumns,不会恢复到最开始的列宽状态A。
不知道我这么说,可否理解。或者我的需求是否合理?

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

No branches or pull requests

2 participants