Navigating to current location ("/") is not allowed

 main.js

import Router from 'vue-router'

// 这个是为了避免一个报错
const originalPush = Router.prototype.push;
Router.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}

猜你喜欢

转载自www.cnblogs.com/dianzan/p/12377049.html