mirror of
https://github.com/nuxt/nuxt.git
synced 2025-03-21 16:55:57 +00:00
fix(nuxt): add back fallback nuxtlink type signature
This commit is contained in:
parent
39c2b0a2c4
commit
a8856de591
@ -497,11 +497,11 @@ export function defineNuxtLink (options: NuxtLinkOptions) {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
// }) as unknown as DefineComponent<NuxtLinkProps, object, object, ComputedOptions, MethodOptions, object, object, EmitsOptions, string, object, NuxtLinkProps, object, SlotsType<NuxtLinkSlots>>
|
// }) as unknown as DefineComponent<NuxtLinkProps, object, object, ComputedOptions, MethodOptions, object, object, EmitsOptions, string, object, NuxtLinkProps, object, SlotsType<NuxtLinkSlots>>
|
||||||
}) as unknown as new<CustomProp extends boolean = false>(props: NuxtLinkProps<CustomProp>) => InstanceType<DefineSetupFnComponent<
|
}) as unknown as (new<CustomProp extends boolean = false>(props: NuxtLinkProps<CustomProp>) => InstanceType<DefineSetupFnComponent<
|
||||||
NuxtLinkProps<CustomProp>,
|
NuxtLinkProps<CustomProp>,
|
||||||
[],
|
[],
|
||||||
SlotsType<NuxtLinkSlots<CustomProp>>
|
SlotsType<NuxtLinkSlots<CustomProp>>
|
||||||
>>
|
>>) & Record<string, any>
|
||||||
}
|
}
|
||||||
|
|
||||||
export default defineNuxtLink(nuxtLinkDefaults)
|
export default defineNuxtLink(nuxtLinkDefaults)
|
||||||
|
3
test/fixtures/basic-types/types.ts
vendored
3
test/fixtures/basic-types/types.ts
vendored
@ -255,6 +255,9 @@ describe('typed router integration', () => {
|
|||||||
// @ts-expect-error this is an invalid param
|
// @ts-expect-error this is an invalid param
|
||||||
h(NuxtLink, { to: { name: 'param-id', params: { bob: 23 } } })
|
h(NuxtLink, { to: { name: 'param-id', params: { bob: 23 } } })
|
||||||
h(NuxtLink, { to: { name: 'param-id', params: { id: 4 } } })
|
h(NuxtLink, { to: { name: 'param-id', params: { id: 4 } } })
|
||||||
|
|
||||||
|
// doesn't throw an error when accessing properties of component
|
||||||
|
const _props = NuxtLink.props
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user