router.js 640 B

12345678910111213141516171819202122
  1. import { createRouter , createWebHashHistory } from 'vue-router';
  2. import Home from "./component/Home.vue";
  3. import test from "./component/test.vue";
  4. import About from "./component/About.vue";
  5. import Login from "./component/approve/Login.vue";
  6. import Register from "./component/approve/Register.vue";
  7. const routes=[
  8. { path:'/',redirect:'/home' },
  9. { path:'/home',component:Home },
  10. { path:'/test',component:test },
  11. { path:'/about',component:About },
  12. { path:'/login',component:Login },
  13. { path:'/register',component:Register },
  14. ];
  15. const router = createRouter({
  16. routes,
  17. history:createWebHashHistory()
  18. });
  19. export default router;