*/
export function onBeforeRouteLeave(leaveGuard: NavigationGuard) {
if (__DEV__ && !getCurrentInstance()) {
- warn('onBeforeRouteLeave must be called at the top of a setup function')
+ warn(
+ 'getCurrentInstance() returned null. onBeforeRouteLeave() must be called at the top of a setup function'
+ )
return
}
if (!activeRecord) {
__DEV__ &&
- warn('onBeforeRouteLeave must be called at the top of a setup function')
+ warn(
+ 'No active route record was found. Are you missing a <router-view> component?'
+ )
return
}
*/
export function onBeforeRouteUpdate(updateGuard: NavigationGuard) {
if (__DEV__ && !getCurrentInstance()) {
- warn('onBeforeRouteUpdate must be called at the top of a setup function')
+ warn(
+ 'getCurrentInstance() returned null. onBeforeRouteUpdate() must be called at the top of a setup function'
+ )
return
}
if (!activeRecord) {
__DEV__ &&
- warn('onBeforeRouteUpdate must be called at the top of a setup function')
+ warn(
+ 'No active route record was found. Are you missing a <router-view> component?'
+ )
return
}