vue路由中 Navigating to current location ("/xxx") is not allowed

原因:报错原因:多次点击同一路由,导致路由被多次添加

解决:在引入路由的地方

import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)
//重写router的push方法

  const VueRouterPush = router.prototype.push

  router.prototype.push = function push (to) {

    return VueRouterPush.call(this, to).catch(err => err)

  }

原文地址:https://www.cnblogs.com/j190512/p/12752206.html