refactor(http): 重构http模块结构,优化文件组织
- 将alova和vue-query相关文件移动到http目录下 - 统一工具类文件到http/tools目录 - 删除冗余的service/app目录 - 更新相关引用路径 - 添加新的vue-query实现文件
This commit is contained in:
11
src/api/foo-vue-query.ts
Normal file
11
src/api/foo-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