]> git.ipfire.org Git - thirdparty/vuejs/router.git/commitdiff
docs: add comments
authorEduardo San Martin Morote <posva13@gmail.com>
Tue, 21 Jul 2020 09:46:52 +0000 (11:46 +0200)
committerEduardo San Martin Morote <posva13@gmail.com>
Tue, 21 Jul 2020 09:46:52 +0000 (11:46 +0200)
src/RouterView.ts
src/matcher/types.ts

index f0ec73e46160455318d7fc466d63bffdd5e62883..f51fc953d4f1a91e4fdd574e3528f668a77a8e49 100644 (file)
@@ -70,7 +70,7 @@ export const RouterViewImpl = defineComponent({
           : routePropsOption
         : null
 
-      // we nee the value at the time we render because when we unmount, we
+      // we need the value at the time we render because when we unmount, we
       // navigated to a different location so the value is different
       const currentName = props.name
       const onVnodeMounted = () => {
index cbf0c39ed9e2e963a742b9ace916f6ac38797395..ffef55f4f587fa356ea794a1b9dc2c343f07f347 100644 (file)
@@ -23,6 +23,12 @@ export interface RouteRecordNormalized {
   leaveGuards: NavigationGuard[]
   updateGuards: NavigationGuard[]
   enterCallbacks: NavigationGuardNextCallback[]
+  // having the instances on the record mean beforeRouteUpdate and
+  // beforeRouteLeave guards can only be invoked with the latest mounted app
+  // instance if there are multiple application instances rendering the same
+  // view, basically duplicating the content on the page, which shouldn't happen
+  // in practice. It will work if multiple apps are rendering different named
+  // views.
   instances: Record<string, ComponentPublicInstance | undefined | null>
   // can only be of of the same type as this record
   aliasOf: RouteRecordNormalized | undefined