index.ts 587 B

1234567891011121314151617181920212223
  1. import { createRouter, createWebHistory } from 'vue-router'
  2. import HomeView from '../views/HomeView.vue'
  3. const router = createRouter({
  4. history: createWebHistory(import.meta.env.BASE_URL),
  5. routes: [
  6. {
  7. path: '/',
  8. name: 'home',
  9. component: HomeView
  10. },
  11. {
  12. path: '/about',
  13. name: 'about',
  14. // route level code-splitting
  15. // this generates a separate chunk (About.[hash].js) for this route
  16. // which is lazy-loaded when the route is visited.
  17. component: () => import('../views/AboutView.vue')
  18. }
  19. ]
  20. })
  21. export default router