寫項目的時候,報了一個錯,現在總結出來,希望可以幫助到你們。
這個報錯的原因:使用新導航取消了從“/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) }