解决报错(Navigation cancelled from “/roleList“ to “/userlist“ with a new navigation.)


写项目的时候,报了一个错,现在总结出来,希望可以帮助到你们。

在这里插入图片描述
这个报错的原因:使用新导航取消了从“/roleList”到“/userlist”的导航。

解决的方法:

关于Vue Router报错

路由跳转报错问题只需要在router中的index.js中写:

import Vue from ‘vue’

import VueRouter from ‘vue-router’

Vue.use(VueRouter)

const originalPush = VueRouter.prototype.push VueRouter.prototype.push = function push (location) { return originalPush.call(this, location).catch(err => err) }

在这里插入图片描述


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM