PetyXbron
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