Skip to content

Commit f55a319

Browse files
committed
Remove console.log in router.push/replace, because navigation like a next(object) always reject, after vue-router v3.1.0.Also see vuejs/vue-router#2881 (comment)
1 parent a31c178 commit f55a319

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

Diff for: src/mixin.js

+2-16
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,7 @@ let eventRegister = function(router) {
1010

1111
router.push = (location, onResolve, onReject) => {
1212
history.action = config.pushName;
13-
if (onResolve || onReject) {
14-
return routerPush(location, onResolve, onReject);
15-
}
16-
return routerPush(location).catch(error => {
17-
if (error !== undefined) {
18-
console.log(error);
19-
}
20-
});
13+
return routerPush(location, onResolve, onReject);
2114
};
2215

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

2821
router.replace = (location, onResolve, onReject) => {
2922
history.action = config.replaceName;
30-
if (onResolve || onReject) {
31-
return routerReplace(location, onResolve, onReject);
32-
}
33-
return routerReplace(location).catch(error => {
34-
if (error !== undefined) {
35-
console.log(error);
36-
}
37-
});
23+
return routerReplace(location, onResolve, onReject);
3824
};
3925

4026
router.back = () => {

0 commit comments

Comments
 (0)