发布时间:2025-12-10 19:52:32 浏览次数:1
解决报错(Navigation cancelled from “/roleList“ to “/userlist“ with a new navigation.)写项目的时候,报了一个错,现在总结出来,希望可以帮助到你们。这个报错的原因:使用新导航取消了从“/roleList”到“/userlist”的导航。解决的方法:关于VueRouter报错路由跳转报错问题只需要在router中的index.js中写:importVuefrom‘vue’importVueRouterfrom‘vue-router’Vue.use(VueRouter)constoriginalPush=VueRouter.prototype.push.
写项目的时候,报了一个错,现在总结出来,希望可以帮助到你们。
关于Vue Router报错
路由跳转报错问题只需要在router中的index.js中写:
import Vue from ‘vue’
import VueRouter from ‘vue-router’
Vue.use(VueRouter)
const originalPush = VueRouter.prototype.pushVueRouter.prototype.push = function push (location) { return originalPush.call(this, location).catch(err => err)}