Closed damienroche closed 10 months ago
Thanks! Have pushed a fix for this, now we explicitly extend the NuxtLinkProps interface to avoid issues like this
Thanks! Have pushed a fix for this, now we explicitly extend the NuxtLinkProps interface to avoid issues like this
Getting error in typecheck after this fix:
On 2.2.5 all ok )
@harlan-zw thanks for the update. Maybe you have to be aware that to
should can also be a RouteLocation
object and in this case the path is located in the path
object key.
<Site-Link :to="{ path: ... }" />
import { RouteLocation } from 'vue-router
const to = computed(() => {
const _to = props.to as string | undefined | RouteLocation
if (!_to || !_to?.path)
return undefined
return linkResolver(typeof _to === 'string' ? _to : _to.path)
})
Thank you, sorry for the oversight. I've merged @damienroche's PR and released in 2.2.8
As a side note, please see https://github.com/harlan-zw/nuxt-site-config/issues/19
Describe the bug
To be fully iso with Nuxt-Link, this prop should accept undefined value https://github.com/harlan-zw/nuxt-site-config/blob/6c312d3042c5cf5644a59d37ad6679e21faf4573/packages/module/src/runtime/nuxt/component/SiteLink.vue#L7
with Nuxt-Link :
with Site-Link :
Reproduction
No response
System / Nuxt Info
No response