From 6fa303fba199b98297d942fb01ddac513d86bd6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matt=20Czapli=C5=84ski?= Date: Wed, 29 Sep 2021 01:20:29 +0200 Subject: [PATCH] fix: Previous route in exposed method --- src/router-mixin.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/router-mixin.ts b/src/router-mixin.ts index 4d9bfb0..42284e3 100644 --- a/src/router-mixin.ts +++ b/src/router-mixin.ts @@ -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( @@ -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(