1、引入router :
import {useRouter} from 'vue-router'
2、定义
let router = useRouter();
3、动态添加路由
router.addRoute({name:"users", path: '/User/users', component: ()=>import("/src/views/User/Users.vue") });
4、跳转要用push,直接通过浏览器地址打不开
router.push("/User/Users")
标签:Users,import,User,Vue3,router,动态,路由,users From: https://www.cnblogs.com/handsomeziff/p/16787970.html