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

[Need Help] 关于defaultParams不是响应式的疑问 #244

Closed
like0413 opened this issue Jul 11, 2024 · 1 comment
Closed

[Need Help] 关于defaultParams不是响应式的疑问 #244

like0413 opened this issue Jul 11, 2024 · 1 comment
Labels
question Further information is requested

Comments

@like0413
Copy link

like0413 commented Jul 11, 2024

问题描述 Problem Description

问题来源于这个:#187

1、如果每次运行run都要重新传参,比较麻烦
2、如果getUser参数不止一个,那在run的时候就需要重新构造参数并考虑传参顺序,心智负担比较大啊

我水平有限,想了解下,没有设计响应式参数的原因是?

其他信息 Other information

@like0413 like0413 added the question Further information is requested label Jul 11, 2024
@John60676
Copy link
Member

如果每次运行run都要重新传参,比较麻烦

稍微封装一下即可解决你提出的那两个问题

function handleSearch() {
  const { name, status } = searchParams.value;
  runAsync({
    name,
    status,
  });
}

没有设计响应式参数的原因是?

没必要把一件简单的事情复杂来做,如果想根据 请求参数的变化响应触发请求的,完全可以在业务层面上,自己利用 watch 来实现

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants