Add in index.js under router file
import Vue from 'vue'; import VueRouter from 'vue-router'; Vue.use(VueRouter); // 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) }
perhaps
const originalReplace = VueRouter.prototype.replace; Router.prototype.replace = function replace(location) { return originalReplace.call(this, location).catch(err => err); };
Similar Posts:
- [Solved] Vue router in the element UI navigation bar repeatedly clicks on the menu above version 3.0 and reports errors
- [Solved] VUE Project Error: Avoided redundant navigation to current location: “/XXX“
- [Solved] Uncaught (in promise) NavigationDuplicated: Avoided redundant navigation to current location
- [Solved] Vue Error: Uncaught (in promise) NavigationDuplicated: Avoided redundant navigation to current location
- Uncaught (in promise) NavigationDuplicated [How to Solve]
- [Solved] Vue Error: NavigationDuplicated: Avoided redundant navigation to current location: “xxx”.
- How to Solve Vue Error: NavigationDuplicated
- [Solved] Uncaught (in promise) NavigationDuplicated: Avoided redundant navigation to
- Resolve Vue the navigationduplicated error on the console
- [Solved] Vue router common problems (push error, push duplicate route refresh)