Files
rustfs-console/composables/useAPI.ts
T
overtrue b86e3f1591 init
2024-12-08 14:19:47 +08:00

12 lines
244 B
TypeScript

import type { UseFetchOptions } from 'nuxt/app'
export function useAPI<T>(
url: string | (() => string),
options?: UseFetchOptions<T>,
) {
return useFetch(url, {
...options,
$fetch: useNuxtApp().$apiFetch as typeof $fetch
})
}