mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 13:45:18 +00:00
fix(nuxt): do not pass listeners to custom NuxtLink
(#28738)
This commit is contained in:
parent
b510609cce
commit
9ad735a349
@ -381,13 +381,15 @@ export function defineNuxtLink (options: NuxtLinkOptions) {
|
|||||||
replace: props.replace,
|
replace: props.replace,
|
||||||
ariaCurrentValue: props.ariaCurrentValue,
|
ariaCurrentValue: props.ariaCurrentValue,
|
||||||
custom: props.custom,
|
custom: props.custom,
|
||||||
onPointerenter: shouldPrefetch('interaction') ? prefetch.bind(null, undefined) : undefined,
|
|
||||||
onFocus: shouldPrefetch('interaction') ? prefetch.bind(null, undefined) : undefined,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// `custom` API cannot support fallthrough attributes as the slot
|
// `custom` API cannot support fallthrough attributes as the slot
|
||||||
// may render fragment or text root nodes (#14897, #19375)
|
// may render fragment or text root nodes (#14897, #19375)
|
||||||
if (!props.custom) {
|
if (!props.custom) {
|
||||||
|
if (shouldPrefetch('interaction')) {
|
||||||
|
routerLinkProps.onPointerenter = prefetch.bind(null, undefined)
|
||||||
|
routerLinkProps.onFocus = prefetch.bind(null, undefined)
|
||||||
|
}
|
||||||
if (prefetched.value) {
|
if (prefetched.value) {
|
||||||
routerLinkProps.class = props.prefetchedClass || options.prefetchedClass
|
routerLinkProps.class = props.prefetchedClass || options.prefetchedClass
|
||||||
}
|
}
|
||||||
@ -427,6 +429,7 @@ export function defineNuxtLink (options: NuxtLinkOptions) {
|
|||||||
return slots.default({
|
return slots.default({
|
||||||
href: href.value,
|
href: href.value,
|
||||||
navigate,
|
navigate,
|
||||||
|
prefetch,
|
||||||
get route () {
|
get route () {
|
||||||
if (!href.value) { return undefined }
|
if (!href.value) { return undefined }
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user