写在router文件下的index.js 下:
// 避免路由重复报错 NavigationDuplicated: Avoided redundant navigation to current location: "//".
const originalPush = Router.prototype.push;
const originalReplace = Router.prototype.replace;
Router.prototype.push = function push(location) {
return originalPush.call(this, location).catch(err => err)
}
Router.prototype.replace = function replace(location) {
return originalReplace.call(this, location).catch(err => err);
};
0 个评论
要回复文章请先登录或注册