Skip to content

Commit

Permalink
Remove console.log in router.push/replace, because navigation like a …
Browse files Browse the repository at this point in the history
…next(object) always reject, after vue-router v3.1.0.Also see vuejs/vue-router#2881 (comment)
  • Loading branch information
a365344743s committed Jun 11, 2020
1 parent a31c178 commit f55a319
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions src/mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,7 @@ let eventRegister = function(router) {

router.push = (location, onResolve, onReject) => {
history.action = config.pushName;
if (onResolve || onReject) {
return routerPush(location, onResolve, onReject);
}
return routerPush(location).catch(error => {
if (error !== undefined) {
console.log(error);
}
});
return routerPush(location, onResolve, onReject);
};

router.go = n => {
Expand All @@ -27,14 +20,7 @@ let eventRegister = function(router) {

router.replace = (location, onResolve, onReject) => {
history.action = config.replaceName;
if (onResolve || onReject) {
return routerReplace(location, onResolve, onReject);
}
return routerReplace(location).catch(error => {
if (error !== undefined) {
console.log(error);
}
});
return routerReplace(location, onResolve, onReject);
};

router.back = () => {
Expand Down

0 comments on commit f55a319

Please sign in to comment.