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)
}

 

posted @ 2020-02-28 14:24  ThisCall  阅读(1229)  评论(0编辑  收藏  举报