在index.js 文件中添加(注:放在Vue.use(VueRouter)前面)
const routePush = VueRouter.prototype.push
VueRouter.prototype.push = function (location) {
return routePush.call(this, location).catch((err) => {err})
}
在index.js 文件中添加(注:放在Vue.use(VueRouter)前面)
const routePush = VueRouter.prototype.push
VueRouter.prototype.push = function (location) {
return routePush.call(this, location).catch((err) => {err})
}