fix(nuxt): pass external to navigate in custom <NuxtLink> (#25887)

This commit is contained in:
Damian Głowala 2024-02-21 22:20:13 +01:00 committed by GitHub
parent 7213b2ddac
commit f2d891cae9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -354,14 +354,14 @@ export function defineNuxtLink (options: NuxtLinkOptions) {
(isAbsoluteUrl.value || hasTarget.value) ? 'noopener noreferrer' : '' (isAbsoluteUrl.value || hasTarget.value) ? 'noopener noreferrer' : ''
) || null ) || null
const navigate = () => navigateTo(href, { replace: props.replace })
// https://router.vuejs.org/api/#custom // https://router.vuejs.org/api/#custom
if (props.custom) { if (props.custom) {
if (!slots.default) { if (!slots.default) {
return null return null
} }
const navigate = () => navigateTo(href, { replace: props.replace, external: props.external })
return slots.default({ return slots.default({
href, href,
navigate, navigate,