index.js 649 B

123456789101112131415161718192021222324252627
  1. import { createRouter, createWebHashHistory } from 'vue-router'
  2. import HomeView from '../views/HomeView.vue'
  3. const routes = [
  4. {
  5. path: '/',
  6. name: 'home',
  7. component: HomeView
  8. },
  9. {
  10. // path: '/about',
  11. // name: 'about',
  12. // route level code-splitting
  13. // this generates a separate chunk (about.[hash].js) for this route
  14. // which is lazy-loaded when the route is visited.
  15. // component: function () {
  16. // return import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
  17. // }
  18. }
  19. ]
  20. const router = createRouter({
  21. history: createWebHashHistory(location.pathname),
  22. routes
  23. })
  24. export default router