index.js 597 B

123456789101112131415161718192021222324252627
  1. import { createRouter, createWebHistory, createWebHashHistory } from 'vue-router'
  2. import Home from '../views/Home.vue'
  3. import List from '../views/List.vue'
  4. import My from '../views/My.vue'
  5. const router = createRouter({
  6. history: createWebHistory(),
  7. routes: [
  8. {
  9. path: '/',
  10. redirect: '/home'
  11. },
  12. {
  13. path: '/home',
  14. component: Home
  15. },
  16. {
  17. path: '/my',
  18. component: My
  19. },
  20. {
  21. path: '/list',
  22. component: List
  23. },
  24. ]
  25. });
  26. export default router;