index.ts 831 B

1234567891011121314151617181920212223242526272829303132333435
  1. import { createRouter, createWebHashHistory } from "vue-router"
  2. import HomeView from "../views/HomeView.vue"
  3. import Login from "@/views/Login.vue"
  4. import RegisterView from "@/views/RegisterView.vue"
  5. const router = createRouter({
  6. history: createWebHashHistory(),
  7. routes: [
  8. {
  9. path: "/",
  10. name: "home",
  11. component: HomeView
  12. },
  13. {
  14. path: "/about",
  15. name: "about",
  16. // route level code-splitting
  17. // this generates a separate chunk (About.[hash].js) for this route
  18. // which is lazy-loaded when the route is visited.
  19. component: () => import("../views/AboutView.vue")
  20. },
  21. {
  22. path: "/login",
  23. name: "登录",
  24. component: Login
  25. },
  26. {
  27. path: "/register",
  28. name: "注册",
  29. component: RegisterView
  30. }
  31. ]
  32. })
  33. export default router