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

Read More: