Skip to content

Commit

Permalink
fix(nuxt): pass external to navigate in custom <NuxtLink> (#25887)
Browse files Browse the repository at this point in the history
  • Loading branch information
DamianGlowala committed Feb 21, 2024
1 parent 7213b2d commit f2d891c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/nuxt/src/app/components/nuxt-link.ts
Original file line number Diff line number Diff line change
Expand Up @@ -354,14 +354,14 @@ export function defineNuxtLink (options: NuxtLinkOptions) {
(isAbsoluteUrl.value || hasTarget.value) ? 'noopener noreferrer' : ''
) || null

const navigate = () => navigateTo(href, { replace: props.replace })

// https://router.vuejs.org/api/#custom
if (props.custom) {
if (!slots.default) {
return null
}

const navigate = () => navigateTo(href, { replace: props.replace, external: props.external })

return slots.default({
href,
navigate,
Expand Down

0 comments on commit f2d891c

Please sign in to comment.