Skip to content

Commit

Permalink
fix: Previous route in exposed method
Browse files Browse the repository at this point in the history
  • Loading branch information
MattCCC committed Sep 28, 2021
1 parent 5b93b19 commit 6fa303f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/router-mixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export default {
}

const to = (this.$router as RouterService).getNewRoute();
const from = (this.$router as RouterService).getCurrentRoute();
const from = (this.$router as RouterService).getPreviousRoute();

if (this.$options.beforeRouteLeave) {
this.$options.beforeRouteLeave.call(
Expand Down Expand Up @@ -92,7 +92,7 @@ export default {

onNavigatingTo(data) {
const to = (this.$router as RouterService).getNewRoute();
const from = (this.$router as RouterService).getCurrentRoute();
const from = (this.$router as RouterService).getPreviousRoute();

if (this.$options.beforeRouteUpdate && to && from && to.path === from.path) {
this.$options.beforeRouteUpdate.call(
Expand Down

0 comments on commit 6fa303f

Please sign in to comment.