admin管理员组

文章数量:1612098

在router.js中加入以下代码就可以

const originalPush = Router.prototype.push
Router.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}

如果你的改了push还是没有生效,修改路由replace方法,阻止重复点击报错

const originalReplace = VueRouter.prototype.replace;
VueRouter.prototype.replace = function replace(location) {
  return originalReplace.call(this, location).catch(err => err);
};

 

本文标签: 解决方法ErrorAvoidedUncaughtpromise