PetyXbron
PetyXbron
NNuxt
Created by PetyXbron on 4/25/2025 in #❓・help
Getting route params after changing route
@kapa.ai Hi guys, I am having a serious issue with vue-router in the past few days. I'm not sure if this is correct or meant to be. I am redirecting/routing within the app by return await navigateTo({ path: /app/VALUE});, and in the middleware - to.path, neither to.fullPath doesn't display correct information... It displays just /, but the navigation happens successfully anyways... To reach my goal, I am trying useRoute().params.VALUE in my Layout of the page. It's undefined. It only works when I refresh the page after the redirect or whenever I visit the URL with the param directly. Using watch() or onMounted() functions in the Layout doesn't help to get the param.. Is there any way to fix that? Am I missing something?
Using [email protected] [email protected] (the latest ones)
15 replies
NNuxt
Created by PetyXbron on 4/25/2025 in #❓・help
Getting route params after changing route
@kapa.ai even waiting few seconds doesn't trigger the watch() event. Why I cannot access route params immediately? Wouldn't vanilla JS work here with window.location functions?
15 replies