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

[Bug Report] manual usePagination 手动refreshAsync 会丢失 defaultParams #208

Open
Colory opened this issue Jul 6, 2023 · 2 comments

Comments

@Colory
Copy link

Colory commented Jul 6, 2023

Bug 描述 Bug description

usePagination请求的时候如果是手动请求
会丢失defaultParams 参数信息

代码重现 Reproduce

const { refreshAsync } = usePagination(p => console.log(p), { manual: true, defaultParams: [{current: 1, pageSize: 10}] })

const clickRefresh = () => refreshAsync()

期望结果 Desired result

期望是p参数存在
结果并没有携带该参数

其他信息 Other information

版本 2.0.3

@Colory Colory changed the title manual usePagination 手动refreshAsync 会丢失 defaultParams [Bug Report] manual usePagination 手动refreshAsync 会丢失 defaultParams Jul 6, 2023
@John60676
Copy link
Member

refresh 是使用上一次请求的 params 再次发起请求

参考:https://www.attojs.com/api/#refresh

@Colory
Copy link
Author

Colory commented Jul 6, 2023

refresh 是使用上一次请求的 params 再次发起请求

参考:https://www.attojs.com/api/#refresh

但是第一次调用就不太符合固有映像了,因为自动发起请求的时候是会带上defaultParams的。改成手动理论上应该就是和自动保持一致

如果要把分页的请求手动调用时候带上defaultParams 还需要手动添加参数

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