]> git.ipfire.org Git - thirdparty/vuejs/router.git/commitdiff
docs: fix suspense example
authorEduardo San Martin Morote <posva13@gmail.com>
Wed, 29 Sep 2021 08:14:26 +0000 (10:14 +0200)
committerEduardo San Martin Morote <posva13@gmail.com>
Wed, 29 Sep 2021 08:14:26 +0000 (10:14 +0200)
docs/api/index.md

index 1273d6c0caa50a4e1cf36cf9ab198b343b9ef82d..e95b80e41ca53b76c072221a7e7d16ef828af290 100644 (file)
@@ -168,21 +168,21 @@ If you add a `target="_blank"` to your `a` element, you must omit the `@click="n
 `<router-view>` exposes a `v-slot` API mainly to wrap your route components with `<transition>` and `<keep-alive>` components.
 
 ```html
-<Suspense>
-  <template #default>
-    <router-view v-slot="{ Component, route }">
-      <transition :name="route.meta.transition || 'fade'" mode="out-in">
-        <keep-alive>
+<router-view v-slot="{ Component, route }">
+  <transition :name="route.meta.transition || 'fade'" mode="out-in">
+    <keep-alive>
+      <suspense>
+        <template #default>
           <component
             :is="Component"
             :key="route.meta.usePathKey ? route.path : undefined"
           />
-        </keep-alive>
-      </transition>
-    </router-view>
-  </template>
-  <template #fallback> Loading... </template>
-</Suspense>
+        </template>
+        <template #fallback> Loading... </template>
+      </suspense>
+    </keep-alive>
+  </transition>
+</router-view>
 ```
 
 - `Component`: VNodes to be passed to a `<component>`'s `is` prop.