feat(vue-query): 添加 vue-query 示例页面和相关功能

新增 vue-query 示例页面,包含请求演示功能
添加 vue-query 服务层代码和页面跳转逻辑
清理 request.vue 中不再使用的代码注释
This commit is contained in:
feige996
2025-07-16 21:25:38 +08:00
parent 614aadc285
commit feb3d8104b
5 changed files with 84 additions and 12 deletions

View 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],
})
}