From 7a1934509efab2254aad1fccfd1d5090811ac84d Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Sat, 1 Mar 2025 00:40:07 +0000 Subject: [PATCH] fix(nuxt): align type of custom `navigate` with `vue-router` --- packages/nuxt/src/app/components/nuxt-link.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 & {