Skip to content

Commit a56fce2

Browse files
committed
docs: fix suspense example
1 parent 5dd5f47 commit a56fce2

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

docs/api/index.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -168,21 +168,21 @@ If you add a `target="_blank"` to your `a` element, you must omit the `@click="n
168168
`<router-view>` exposes a `v-slot` API mainly to wrap your route components with `<transition>` and `<keep-alive>` components.
169169

170170
```html
171-
<Suspense>
172-
<template #default>
173-
<router-view v-slot="{ Component, route }">
174-
<transition :name="route.meta.transition || 'fade'" mode="out-in">
175-
<keep-alive>
171+
<router-view v-slot="{ Component, route }">
172+
<transition :name="route.meta.transition || 'fade'" mode="out-in">
173+
<keep-alive>
174+
<suspense>
175+
<template #default>
176176
<component
177177
:is="Component"
178178
:key="route.meta.usePathKey ? route.path : undefined"
179179
/>
180-
</keep-alive>
181-
</transition>
182-
</router-view>
183-
</template>
184-
<template #fallback> Loading... </template>
185-
</Suspense>
180+
</template>
181+
<template #fallback> Loading... </template>
182+
</suspense>
183+
</keep-alive>
184+
</transition>
185+
</router-view>
186186
```
187187

188188
- `Component`: VNodes to be passed to a `<component>`'s `is` prop.

0 commit comments

Comments
 (0)