mirror of
https://github.com/rustfs/console.git
synced 2026-10-31 03:52:11 +08:00
9 lines
240 B
TypeScript
9 lines
240 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,
|
|
});
|
|
}
|