描述:点击按钮进行跳转时,路由为当前路由,再次点击报错
解决方法:
在router的index.js文件中添加
const originalPush:any = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
return originalPush.call(this, location).catch(err => err)
}
描述:点击按钮进行跳转时,路由为当前路由,再次点击报错
解决方法:
在router的index.js文件中添加
const originalPush:any = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
return originalPush.call(this, location).catch(err => err)
}