解决Vue项目开发中,出现message: "Navigating to current location (XXX) is not allowed"的问题
解决:在router/index.js文件中添加
import Vue from 'vue'
import Router from 'vue-router'
// push,阻止重复点击报错,兼容ie报错
const originalPush = Router.prototype.push
Router.prototype.push = function psuh (location) {
return originalPush.call(this, location).catch(err => err)
}
Vue.use(Router)