mirror of
https://github.com/rustfs/console.git
synced 2026-08-30 17:14:47 +08:00
12 lines
244 B
TypeScript
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
|
|
})
|
|
}
|