-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Warning will appear when passing an external link to <NuxtLink>
#27312
Comments
|
I've tested various scenarios regarding this PR #26522 and noticed that the <script setup lang="ts">
import { useLink } from 'vue-router'
const props = shallowReactive({
to: 'https://mini-ghost.dev',
})
const { isActive } = useLink(props)
const { isActive: isNuxtLinkActive } = resolveComponent('NuxtLink').useLink(props)
const onClick = () => {
if (props.to === '/') {
props.to = '/about'
} else {
props.to = '/'
}
}
</script>
<template>
<div>
<button @click="onClick">
Click
</button>
isActive {{ isActive }} <br>
isNuxtLinkActive: {{ isNuxtLinkActive }}
</div>
</template> When we switch routes by clicking the nuxt/packages/nuxt/src/app/components/nuxt-link.ts Lines 148 to 151 in 2efaa26
Here, we are destructuring the passed Should we align |
Nice find! Yes, we should ensure this remains reactive. |
Environment
Reproduction
https://stackblitz.com/edit/nuxt-starter-jphpju?file=app.vue
Describe the bug
[Vue Router warn]: No match found for location with path "https://nuxt.com/"
.Additional context
This might be related to this PR: #26522.
Logs
N/A
The text was updated successfully, but these errors were encountered: