-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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(useAntdTable): reset pageSize (#2085) #2090
Conversation
修复了这个 issues |
4cd2fe2
to
f96c371
Compare
ready for review @crazylxr |
@Ali-ovo 补个测试用例 |
f96c371
to
15d36b6
Compare
hooks/packages/hooks/src/useAntdTable/index.tsx Lines 158 to 163 in b92ca0e
貌似 defaultParams 和 defaultPageSize 会有一个同时存在的情况 所有导致 reset 有些歧义目前 reset 的逻辑是优先判断的 defaultParams
|
收到。
|
个人感觉
而不是重复定义 |
defaultParams应该作为初始默认项,而不是重置默认项使用,current作为页码,在重置就应该回到第一页,而不是去读取defaultParams的current。如果想要改变defaultParams的定义,那是不是应该加参数或者配置作为初始值,初始值只是作为页面刷新或者跳转保留历史项使用
发自我的iPhone
…------------------ Original ------------------
From: ZhuoYang Wu(阿离) ***@***.***>
Date: Mon,Apr 24,2023 5:28 PM
To: alibaba/hooks ***@***.***>
Cc: Fairy ***@***.***>, Comment ***@***.***>
Subject: Re: [alibaba/hooks] fix(useAntdTable): reset pageSize (#2085) (PR#2090)
这个版本修复修出bug了。
如果reset要充值页码,应该用reset defaultPageSize, 而不是defaultParams,defaultParams是作为初次传参使用的。不然的话,refreshDeps的说明是refreshDeps 变化,会重置 current 到第一页,并重新发起请求。现在这个版本,会把current重置到defaultParams的current. 希望尽快修复!!!! @crazylxr @Ali-ovo
https://github.com/alibaba/hooks/blob/b92ca0e4a5265d00e50f1b7d5e073ffaa0b20019/packages/hooks/src/useAntdTable/index.tsx#L158-L163
貌似 defaultParams 和 defaultPageSize 会有一个同时存在的情况 所有导致 reset 有些歧义
目前 reset 的逻辑是优先判断的 defaultParams
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.Message ID: ***@***.***>
|
@Ali-ovo 帮忙看下,不行先回滚回去哈 |
This reverts commit 2d2cd69.
[中文版模板 / Chinese template]
🤔 This is a ...
🔗 Related issue link
fix: #2085
💡 Background and solution
📝 Changelog
☑️ Self Check before Merge