在 router 的配置文件里下添加一下代码(在use之前):
import Router from 'vue-router'
const originalPush = Router.prototype.push
Router.prototype.push = function push(location) {
return originalPush.call(this, location).catch(err => err)
}
版权声明:本文为qq_46124502原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。