vue-router Uncaught (in promise) NavigationDuplicated

// 解决两次点击同一个路由

import Router from 'vue-router'

const originalPush = Router.prototype.push

Router.prototype.push = function push(location, onResolve, onReject) {

if (onResolve || onReject) return originalPush.call(this, location, onResolve, onReject)

return originalPush.call(this, location).catch(err => err)

}

参考:https://blog.csdn.net/weixin_45522694/article/details/99548714

你可能感兴趣的:(vue,路由重复)