We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
我一个页面参数会变,参数变化后需要重新请求,且确保旧的数据要清空,目前我这样做,总是报类型错误
const { data, error, loading, run, cancel, mutate } = useRequest(GetMarketStatusBinding, { defaultParams: [ { market: 1, accountId: '', }, ], }); const reset = () => { mutate([]) };
The text was updated successfully, but these errors were encountered:
我也不想用as :sad
Sorry, something went wrong.
重新请求让新数据覆盖旧的数据不就可以了吗。如果你是要实现“清空”,我建议data套一层computed,通过computed实现你想要的功能
computed
@John60676 同一个页面复用,只是query变化的情况下,有时候不想保留上一个请求的旧数据,需要重新请求前清空旧的数据。
既然data初始时就是undefined,我觉得不如mutate函数的入参类型允许undefined类型 @AttoJS
No branches or pull requests
问题描述 Problem Description
我一个页面参数会变,参数变化后需要重新请求,且确保旧的数据要清空,目前我这样做,总是报类型错误
The text was updated successfully, but these errors were encountered: