11import { ref , onScopeDispose } from 'vue'
22import type { Ref , Plugin as VuePlugin } from 'vue'
33import { createHooks } from 'hookable'
4-
4+ import { usePage , router } from '@inertiajs/vue3'
5+ import { useColorMode as useColorModeVueUse } from '@vueuse/core'
56import appConfig from '#build/app.config'
67import type { NuxtApp } from '#app'
7- import { useColorMode as useColorModeVueUse } from '@vueuse/core'
8- import { usePage } from '@inertiajs/vue3'
98
109export { useHead } from '@unhead/vue'
10+ export { router as useRouter } from '@inertiajs/vue3'
1111
1212export { useAppConfig } from '../vue/composables/useAppConfig'
1313export { defineShortcuts } from '../composables/defineShortcuts'
@@ -16,15 +16,12 @@ export { useLocale } from '../composables/useLocale'
1616
1717export const useRoute = ( ) => {
1818 const page = usePage ( )
19+
1920 return {
2021 fullPath : page . url
2122 }
2223}
2324
24- export const useRouter = ( ) => {
25-
26- }
27-
2825export const useColorMode = ( ) => {
2926 if ( ! appConfig . colorMode ) {
3027 return {
@@ -88,6 +85,10 @@ export function useRuntimeHook(name: string, fn: (...args: any[]) => void): void
8885 onScopeDispose ( unregister )
8986}
9087
88+ export function clearError ( options : { redirect : string } ) {
89+ return router . push ( { url : options . redirect } )
90+ }
91+
9192export function defineNuxtPlugin ( plugin : ( nuxtApp : NuxtApp ) => void ) {
9293 return {
9394 install ( app ) {
0 commit comments