[vue] vue router 点击同一路由多次或是push的路由是当前界面的url,报错解决方法

// 多次点击同一路由报错

const originalPush = VueRouter.prototype.push

VueRouter.prototype.push = function push (location) {
    
    undefined

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

}

把这个放在路由router的页面






参考: https://blog.csdn.net/sunlizhen/article/details/109162845

猜你喜欢

转载自blog.csdn.net/qq_14993591/article/details/121372834