At the moment I am displaying google maps in a div, whenever I change route, I want to replace the view with another view. I tried to set it as below, but it doesn't work
.map-col(ref="mapCol" v-if="route.name == 'Adventure'")
.map-col(v-else)
router-view
{
path: "/adventures/id",
name: "Adventure",
component: Adventure,
children: [
{
path: "points/id/clues/new",
name: "NewClue",
component: NewClue
}
]
}
console.log(route.name) Outputs Adventure
so it's fine.
Error I am getting
Uncaught (in promise) TypeError: Cannot read property 'name' of undefined
and screen page going fully white.