Exercice 2

router/routes.js
const routes = [
  {
    path: '/',
    component: () => import('layouts/MainLayout.vue'),
    children: [
      { path: '', component: () => import('pages/Index.vue') },
      { path: 'hello', component: () => import('pages/Hello.vue') },
      { path: 'ex1', component: () => import('pages/Exercice1.vue') },
      { path: 'ex2', component: () => import('pages/Exercice2.vue') }
    ]
  }
]

// Always leave this as last one
if (process.env.MODE !== 'ssr') {
  routes.push({
    path: '*',
    component: () => import('pages/Error404.vue')
  })
}

export default routes

Mis à jour

Ce contenu vous a-t-il été utile ?