Skip to content

Commit 97c6d83

Browse files
committed
fix: beforeEnter checks
1 parent 3dcfcf5 commit 97c6d83

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
@@ -103,7 +103,7 @@ export default {
103103
);
104104
}
105105

106-
if (to.beforeEnter && typeof to.beforeEnter === "function") {
106+
if (to && to.beforeEnter && typeof to.beforeEnter === "function") {
107107
const next = (vmContext) => {
108108
if (typeof vmContext === "undefined") {
109109
return;
@@ -116,7 +116,7 @@ export default {
116116
}
117117
};
118118

119-
this.$options.beforeEnter.call(
119+
to.beforeEnter.call(
120120
this,
121121
to,
122122
from,

0 commit comments

Comments
 (0)