I’m trying to have some logic in my root App.vue (as soon as the app loads) that depends on the current route, but I’m finding the route.name
to be undefined
, and when I tried logging the path
it was incorrect.
I found a solution here:
Wrap your code in router.isReady()
like this:
router.isReady().then(() => {
...
});