fix(nuxt3)!: sync route object to currently resolved page#4092
Conversation
✅ Deploy Preview for nuxt3-docs ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
|
Nice work @danielroe It would be nice to test indeed and check if it works when using a nested page too 😊 |
pi0
left a comment
There was a problem hiding this comment.
Looks good to me. Please ping when did additional tests otherwise we can try with edge to test behavior.
|
Tested ✅ Note: At the moment, a nested page's async setup doesn't block the loading of the parent, which means it doesn't block the updating of the |
|
@danielroe I fighting with following case:
<template>
<div>
<NuxtLayout>
<NuxtPage/>
</NuxtLayout>
</div>
</template>
<template>
<div>
<NuxtLink to="/hi.html">
Go to Hi page
</NuxtLink>
</div>
</template>
<template>
<div>
<h1>Hi</h1>
</div>
</template>
<script lang="ts" setup>
const route = useRoute()
console.log(route.params)
</script>
{}How can i get |
|
Im going back to |
🔗 Linked issue
resolves nuxt/nuxt#13645, resolves https://github.com/nuxt/framework/discussions/2459
❓ Type of change
📚 Description
This PR does two things:
useRoute()did not return the correct route until the plugin lifecycle had fully run)I would especially welcome testing on this given the nature of the change.
📝 Checklist