前言
这个月使用vue3来架构公司后端项目,刚好要弄动态路由,我这里就抛砖引玉一下
开始
ruoter - config.ts
import {RouteRecordRaw} from "vue-router";
import LayoutView from "@/layout/IndexLayoutView.vue";
const routesList: Array<RouteRecordRaw> = [
{
path: '/login',
name: 'login',
component: () => import(/* webpackChunkName: "login" */ '@/views/login/IndexLoginView.vue')
},
{
path: '/',
name: 'layout',
component: LayoutView,
redirect: '/home',
children: [
{
path: '404',
component: () => import(/* webpackChunkName: &