Skip to content

Commit 0981990

Browse files
committed
fix(nuxt): do not allow native attrs to shadow nuxt link props
1 parent 7543fad commit 0981990

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/nuxt/src/app/components/nuxt-link.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ export function defineNuxtLink (options: NuxtLinkOptions) {
422422

423423
return () => {
424424
if (!isExternal.value && !hasTarget.value && !isHashLinkWithoutHashMode(to.value)) {
425-
const routerLinkProps: RouterLinkProps & VNodeProps & AllowedComponentProps & Omit<AnchorHTMLAttributes, 'href'> = {
425+
const routerLinkProps: RouterLinkProps & VNodeProps & AllowedComponentProps & AnchorHTMLAttributes = {
426426
ref: elRef,
427427
to: to.value,
428428
activeClass: props.activeClass || options.activeClass,
@@ -526,8 +526,8 @@ export function defineNuxtLink (options: NuxtLinkOptions) {
526526
}
527527
},
528528
// }) as unknown as DefineComponent<NuxtLinkProps, object, object, ComputedOptions, MethodOptions, object, object, EmitsOptions, string, object, NuxtLinkProps, object, SlotsType<NuxtLinkSlots>>
529-
}) as unknown as (new<CustomProp extends boolean = false>(props: NuxtLinkProps<CustomProp> & VNodeProps & AllowedComponentProps & AnchorHTMLAttributes) => InstanceType<DefineSetupFnComponent<
530-
NuxtLinkProps<CustomProp> & VNodeProps & AllowedComponentProps & Omit<AnchorHTMLAttributes, 'href'>,
529+
}) as unknown as (new<CustomProp extends boolean = false>(props: NuxtLinkProps<CustomProp> & VNodeProps & AllowedComponentProps & Omit<AnchorHTMLAttributes, keyof NuxtLinkProps<CustomProp>>) => InstanceType<DefineSetupFnComponent<
530+
NuxtLinkProps<CustomProp> & VNodeProps & AllowedComponentProps & Omit<AnchorHTMLAttributes, keyof NuxtLinkProps<CustomProp>>,
531531
[],
532532
SlotsType<NuxtLinkSlots<CustomProp>>
533533
>>) & Record<string, any>

0 commit comments

Comments
 (0)