feige996 15952919a4 refactor(about): 在request组件中引入useRequest和ref
重构about页面的request组件,添加了useRequest hook和vue的ref引用,为后续功能扩展做准备
2025-06-03 19:55:29 +08:00

9 lines
605 B
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import useRequest from '@/hooks/useRequest' import { getFooAPI, postFooAPI, IFooItem } from
'@/service/index/foo' import { ref } from 'vue' // import { findPetsByStatusQueryOptions } from
'@/service/app' // import { useQuery } from '@tanstack/vue-query' const recommendUrl =
ref('http://laf.run/signup?code=ohaOgIX') // const initialData = { // name: 'initialData', // id:
'1234', // } const initialData = undefined //
适合少部分全局性的接口多个页面都需要的请求接口额外编写一个 Service const { loading, error,
data, run } = useRequest
<IFooItem></IFooItem>