When trying to get sub-routes to work using vue-router
, my sub-routes are rendering the parent route component and not the declared component for that sub-route. It seems that a component must be declared for a parent route, or no component will be displayed at all. For instance, if I declare my routes like this:
Router.map({
'/login': {
component: Login
},
'/stations': {
subRoutes: {
'/': {
component: Station
},
'/create': {
component: CreateStation
}
}
},
});
Nothing is displayed on any route. But if I declare my routes like this:
Router.map({
'/login': {
component: Login
},
'/stations': {
component: Station,
subRoutes: {
'/create': {
component: CreateStation
}
}
},
});
My stations/create
route displays the same component as the stations
route. What gives?