feat(vue-query): 添加 vue-query 示例页面和相关功能
新增 vue-query 示例页面,包含请求演示功能 添加 vue-query 服务层代码和页面跳转逻辑 清理 request.vue 中不再使用的代码注释
This commit is contained in:
11
src/service/index/vue-query.ts
Normal file
11
src/service/index/vue-query.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { queryOptions } from '@tanstack/vue-query'
|
||||
import { getFooAPI } from './foo'
|
||||
|
||||
export function getFooQueryOptions(name: string) {
|
||||
return queryOptions({
|
||||
queryFn: async ({ queryKey }) => {
|
||||
return getFooAPI(queryKey[1])
|
||||
},
|
||||
queryKey: ['getFoo', name],
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user