Hi I have two templates:
- The main site template, for normal pages with two bars in the sides:
Main.vue
- The error pages template, without bars on the sides for errors, like 404:
404.vue
If user enters a normal page, theMain.vue
template should be used, with nested routes for every page. If user enters an inexistent page, the404.vue
template with the error should be used. I Tryied following but it always shows 404 errors except onlocalhost:8080/
(root path access):
router.js:
export default new Router({
mode: 'history',
routes: [{
path: '/',
name: 'main',
component: Main,
childrens: [{
path: '/',
name: 'Home',
components: {
default: () =>
import ('@/views/Home'),
leftInfo: () =>
import ('@/views/DashboardAdditionalInfo'),
rightInfo: () =>
import ('@/components/common/MyTicketsList')
}
},
{
path: 'dashboard',
name: 'Dashboard',
components: {
default: () =>
import ('@/views/Dashboard'),
leftInfo: () =>
import ('@/views/DashboardAdditionalInfo'),
rightInfo: () =>
import ('@/components/common/MyTicketsList')
}
}
]
},
{
path: '*',
name: '404',
component: () =>
import ('@/templates/404.vue')
}
]
})
Any ideas on how to handle this scenario? Of course I can put the 404 handle inside the Main route, but that will show the two side bars.