12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- import { createRouter, createWebHashHistory } from "vue-router";
- const router = createRouter({
- history: createWebHashHistory(),
- routes: [
- {
- path: "/",
- name: "home",
- redirect: "/banner",
- component: () => import("../index"),
- children: [
- {
- path: "/banner",
- component: () => import("../banner"),
- },
- {
- path: "/category",
- component: () => import("../category"),
- },
- {
- path: "/detail/:id",
- component: () => import("../detail"),
- },
- ],
- },
- {
- path: "/login",
- name: "login",
- component: () => import("../login"),
- },
- {
- path: "/404",
- name: "404",
- component: () => import("../../404"),
- },
- {
- path: "/:catchAll(.*)",
- redirect: "/404",
- },
- ],
- });
- // router.beforeEach((to, from) => {
- // return false;
- // });
- export default router;
|