vue router 清空路由规则方法
作者:互联网
替换matcher可以做到 亲测有效 原文链接
import Vue from 'vue' import Router from 'vue-router' Vue.use(Router) const createRouter = () => new Router({ mode: 'history', routes: [] }) const router = createRouter() export function resetRouter () { const newRouter = createRouter() router.matcher = newRouter.matcher // the relevant part } export default router
标签:vue,const,matcher,Router,createRouter,router,路由 来源: https://www.cnblogs.com/qianxiaoPro/p/15714837.html