重写路由的push方法

const routerPush = Router.prototype.push;
Router.prototype.push = function push(location) {
  return routerPush.call(this, location).catch(error => error);
};
posted @ 2020-04-23 16:06  土拨鼠1024  阅读(835)  评论(0)    收藏  举报