File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -52,7 +52,9 @@ function registerGuard(
52
52
*/
53
53
export function onBeforeRouteLeave ( leaveGuard : NavigationGuard ) {
54
54
if ( __DEV__ && ! getCurrentInstance ( ) ) {
55
- warn ( 'onBeforeRouteLeave must be called at the top of a setup function' )
55
+ warn (
56
+ 'getCurrentInstance() returned null. onBeforeRouteLeave() must be called at the top of a setup function'
57
+ )
56
58
return
57
59
}
58
60
@@ -63,7 +65,9 @@ export function onBeforeRouteLeave(leaveGuard: NavigationGuard) {
63
65
64
66
if ( ! activeRecord ) {
65
67
__DEV__ &&
66
- warn ( 'onBeforeRouteLeave must be called at the top of a setup function' )
68
+ warn (
69
+ 'No active route record was found. Are you missing a <router-view> component?'
70
+ )
67
71
return
68
72
}
69
73
@@ -79,7 +83,9 @@ export function onBeforeRouteLeave(leaveGuard: NavigationGuard) {
79
83
*/
80
84
export function onBeforeRouteUpdate ( updateGuard : NavigationGuard ) {
81
85
if ( __DEV__ && ! getCurrentInstance ( ) ) {
82
- warn ( 'onBeforeRouteUpdate must be called at the top of a setup function' )
86
+ warn (
87
+ 'getCurrentInstance() returned null. onBeforeRouteUpdate() must be called at the top of a setup function'
88
+ )
83
89
return
84
90
}
85
91
@@ -90,7 +96,9 @@ export function onBeforeRouteUpdate(updateGuard: NavigationGuard) {
90
96
91
97
if ( ! activeRecord ) {
92
98
__DEV__ &&
93
- warn ( 'onBeforeRouteUpdate must be called at the top of a setup function' )
99
+ warn (
100
+ 'No active route record was found. Are you missing a <router-view> component?'
101
+ )
94
102
return
95
103
}
96
104
You can’t perform that action at this time.
0 commit comments