feat(router): add NuxtLink support for useLink#19514
Conversation
|
Right now there is an alternative using <template>
<NuxtLink to="/someroute" custom #="{ navigate }">
<v-btn @click="navigate">Link</v-btn>
</NuxtLink>
</template> |
|
Router-link is available in nuxt right? How does using this instead behave differently? |
Both are there, this PR should be changed to allow render The linked issue explains the behavior... |
|
Sorry for the confusion: This PR was about adding |
|
That doesn't really answer my question. NuxtLink supports internal and external links but we already have that with to/href. Afaict the only other difference is prefetching but you haven't implemented that in useLink. |
e20cfec to
2766105
Compare
4c970f9 to
6a3285f
Compare
|
Hey everyone! 👋 I was reviewing this PR and wanted to suggest an improvement to make it more flexible and configurable. Currently, the PR directly resolves Proposed Approach:Use const injectedRouterLinkName = inject<string>('vuetify-router-link', 'RouterLink')
const RouterLink = resolveDynamicComponent(injectedRouterLinkName) as typeof _RouterLink | stringThis approach also enables Nuxt users to configure the component name via a plugin while keeping it flexible for other use cases: export default defineNuxtPlugin((nuxtApp) => {
nuxtApp.provide('vuetify-router-link', 'NuxtLink') // Customizable component name
})This would make the implementation more adaptable to different configurations and user preferences. 🚀 |
142b234 to
bb54746
Compare
Description
This PR allows use
useLinkwithNuxtLink, this Nuxt PR should be merged nuxt/nuxt#26522This will work only when:
To register NuxtLink globally we can use a plugin:
vuetify-nuxt-modulewill provide an option to register NuxtLink globally: will allow also to use other name (will register both).resolves #17490