VUE路由点击第二次时报错
作者:互联网
只需在main.js里加入下面代码
import VueRouter from 'vue-router'
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
return originalPush.call(this, location).catch(err => err)
}
如下:
标签:VUE,err,点击,location,VueRouter,push,prototype,路由,originalPush 来源: https://blog.csdn.net/weixin_44428734/article/details/120103363