unibest icon indicating copy to clipboard operation
unibest copied to clipboard

关于 useRequest 的相关问题

Open tlerbao opened this issue 3 months ago • 4 comments

后端菜鸡虚心请教,问题可能比较初级,见笑了。

一、似乎 initialData 参数目前完全没用

二、对于一个页面有多个请求的时候 ,data、run 等变量重复一般是怎么处理的?

const { loading, error, data, run } = useRequest(() => getUserListApi())

我以前都是这面这么用,不套 useRequest

<script lang="ts" setup>
const userList = ref()
const getUserList = async () => {
  const { data } = await getUserListApi()
  userList.value = data
}
getUserList()
</script>

三、路由白名单的示例代码有吗?

四、准备做企业微信内的小程序,必须登录,有代码示例或者思路吗,也是写在路由拦截里吗?

tlerbao avatar May 18 '24 14:05 tlerbao