mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-25 07:05:11 +00:00
fix(nuxt): correct type for useError
(#28996)
This commit is contained in:
parent
068d4ed677
commit
644b6fc1e8
@ -1,13 +1,15 @@
|
||||
import type { H3Error } from 'h3'
|
||||
import { createError as createH3Error } from 'h3'
|
||||
import { toRef } from 'vue'
|
||||
import type { Ref } from 'vue'
|
||||
import { useNuxtApp } from '../nuxt'
|
||||
import type { NuxtPayload } from '../nuxt'
|
||||
import { useRouter } from './router'
|
||||
|
||||
export const NUXT_ERROR_SIGNATURE = '__nuxt_error'
|
||||
|
||||
/** @since 3.0.0 */
|
||||
export const useError = () => toRef(useNuxtApp().payload, 'error')
|
||||
export const useError = (): Ref<NuxtPayload['error']> => toRef(useNuxtApp().payload, 'error')
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
||||
export interface NuxtError<DataT = unknown> extends H3Error<DataT> {}
|
||||
|
Loading…
Reference in New Issue
Block a user