diff --git a/packages/nuxt/src/app/components/nuxt-link.ts b/packages/nuxt/src/app/components/nuxt-link.ts index a3a07573c7..3694b58df9 100644 --- a/packages/nuxt/src/app/components/nuxt-link.ts +++ b/packages/nuxt/src/app/components/nuxt-link.ts @@ -110,7 +110,7 @@ export interface NuxtLinkOptions extends type NuxtLinkDefaultSlotProps = CustomProp extends true ? { href: string - navigate: () => Promise + navigate: (e?: MouseEvent) => Promise prefetch: (nuxtApp?: NuxtApp) => Promise route: (RouteLocation & { href: string }) | undefined rel: string | null @@ -233,7 +233,7 @@ export function defineNuxtLink (options: NuxtLinkOptions) { isActive: link?.isActive ?? computed(() => to.value === router.currentRoute.value.path), isExactActive: link?.isExactActive ?? computed(() => to.value === router.currentRoute.value.path), route: link?.route ?? computed(() => router.resolve(to.value)), - async navigate () { + async navigate (_e?: MouseEvent) { await navigateTo(href.value, { replace: props.replace, external: isExternal.value || hasTarget.value }) }, } satisfies ReturnType & {