mirror of
https://github.com/rustfs/console.git
synced 2026-09-01 15:17:45 +08:00
c019276fcb
Signed-off-by: junxiang Mu <1948535941@qq.com>
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,
|
|
});
|
|
}
|