Tag Archives: avoided redundant navigation to current location

Vue elementui: solution for error: avoided redundant navigation to current location: “/xxx”

The error report shows that the route is repeated, which has no effect on the function, but obsessive-compulsive disorder looks uncomfortable.

Specific performance: repeatedly click the tab menu in the element UI, this error will be reported.

Solution:

 Solve the problem that vue-router in the navigation bar of ElementUI reports an error when repeatedly clicking the menu in version 3.0 or above
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push (location) {
  return originalPush.call(this, location).catch(err => err)
}

Router file index.js Add the above code in.
Note: router or vuerouter depends on the definition in your file.

Vue: How to Solve error avoided redundant navigation to current location: “/xxx”

The solution of error: avoided redundant navigation to current location: “/ xxx” in the project

error reporting shows that the route is repeated, which has no impact on the function.

resolvent:

Router file index.js Add the following code to the

// Solve the problem that vue-router in the navigation bar of ElementUI reports an error when repeatedly clicking the menu in version 3.0 or above
const originalPush = Router.prototype.push
Router.prototype.push = function push (location) {
  return originalPush.call(this, location).catch(err => err)
}

How to Solve Error: avoided redundant navigation to current location: “index/user”

Error: avoided redundant navigation to current location: “index/user” solution

Problem description solution

Problem description

Using the navigation menu made by element UI, when clicking the same navigation continuously, an error will be reported
the error will not affect the function ( Affect obsessive-compulsive disorder )

As shown in the figure

current address http://localhost : 8080/#/index/user
continuous click – user list
jump to the same address http://localhost : 8080/#/index/user

error report

Solutions

import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)
// router folder - >index.js file
//cv the following code to solve the error reporting problem of duplicate routing addresses (once and for all)
const originalPush = VueRouter.prototype.push
   VueRouter.prototype.push = function push(location) {
   return originalPush.call(this, location).catch(err => err)
}