新文章 网摘 文章 随笔 日记

router.push Cannot read property '_normalized' of null

解决办法:router下的index.js添加push重写:
//重写routerPush以免产生router.push Cannot read property '_normalized' of null的错误
const routerPush = Router.prototype.push;
Router.prototype.push = function push(location) {
  return routerPush.call(this, location).catch(error => error)
}

 

posted @ 2020-12-24 15:31  岭南春  阅读(622)  评论(0)    收藏  举报