]> git.ipfire.org Git - thirdparty/vuejs/router.git/commitdiff
feat(warn): improve message for onBeforeRoute*()
authorEduardo San Martin Morote <posva13@gmail.com>
Fri, 1 Oct 2021 09:55:58 +0000 (11:55 +0200)
committerEduardo San Martin Morote <posva13@gmail.com>
Fri, 1 Oct 2021 09:55:58 +0000 (11:55 +0200)
src/navigationGuards.ts

index b8c554ccbc23eae06d9b45bc7247392e783c3256..1da420853c1538eae32f09bda59604b165688061 100644 (file)
@@ -67,7 +67,7 @@ export function onBeforeRouteLeave(leaveGuard: NavigationGuard) {
   if (!activeRecord) {
     __DEV__ &&
       warn(
-        'No active route record was found. Are you missing a <router-view> component?'
+        'No active route record was found when calling `onBeforeRouteLeave()`. Make sure you call this function inside of a component child of <router-view>. Maybe you called it inside of App.vue?'
       )
     return
   }
@@ -99,7 +99,7 @@ export function onBeforeRouteUpdate(updateGuard: NavigationGuard) {
   if (!activeRecord) {
     __DEV__ &&
       warn(
-        'No active route record was found. Are you missing a <router-view> component?'
+        'No active route record was found when calling `onBeforeRouteUpdate()`. Make sure you call this function inside of a component child of <router-view>. Maybe you called it inside of App.vue?'
       )
     return
   }