I have set up a vue router using the vue cli and have created a few components & views etc including a modules view with an ID which can be put in but it keeps loading the dashboard view instead of the module view.
no idea why or how it keeps overriding as when I remove the dashboard routing it works fine.
here is my router code and have tried moving things around with no luck.
export default new Router({
mode: 'history',
base: process.env.BASE_URL,
routes: [
{path: '/', name: 'home', component: Home},
{path: '/about', name: 'about', component: About},
{path: '/login', name: 'login', component: Login},
{path: '/module/:id', name: 'module', component: Module},
{path: '/dashboard', name: 'dashboard', component: Dashboard, children: [
{ path: '/', component: Main},
{ path: 'modules', component: Modules},
]},
],
});
extra info
when i switched the order of the imports so dashboard was imported first and module second then it would switch the issue to only going to module view and not dashboard.
{ path: '/', component: Main},
to{ path: '', component: Main},
? – Steven Spungin