解決報錯(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