Skip to content

Commit 6fa303f

Browse files
committed
fix: Previous route in exposed method
1 parent 5b93b19 commit 6fa303f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/router-mixin.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export default {
6464
}
6565

6666
const to = (this.$router as RouterService).getNewRoute();
67-
const from = (this.$router as RouterService).getCurrentRoute();
67+
const from = (this.$router as RouterService).getPreviousRoute();
6868

6969
if (this.$options.beforeRouteLeave) {
7070
this.$options.beforeRouteLeave.call(
@@ -92,7 +92,7 @@ export default {
9292

9393
onNavigatingTo(data) {
9494
const to = (this.$router as RouterService).getNewRoute();
95-
const from = (this.$router as RouterService).getCurrentRoute();
95+
const from = (this.$router as RouterService).getPreviousRoute();
9696

9797
if (this.$options.beforeRouteUpdate && to && from && to.path === from.path) {
9898
this.$options.beforeRouteUpdate.call(

0 commit comments

Comments
 (0)