Skip to content

Commit 2ee73f2

Browse files
committed
feat: options to disable slide preload, close #102
1 parent 38c07a1 commit 2ee73f2

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

guide/animations.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,27 @@ Slidev has [@vueuse/motion](https://motion.vueuse.org/) built-in. You can use th
166166
</div>
167167
```
168168

169-
The text `Slidev` will move from `-80px` to its original position on revealing.
169+
The text `Slidev` will move from `-80px` to its original position on initialization.
170+
171+
> Note: Slidev preloads the next slide for performance, which means the animations might start before you navigate to the page. To get it works properly, you can disable the preloading for the particular slide
172+
>
173+
> ```md
174+
> ---
175+
> preload: false
176+
> ---
177+
> ```
178+
>
179+
> Or control the element life-cycle with `v-if` to have fine-grained controls
180+
>
181+
> ```html
182+
> <div
183+
> v-if="$slidev.nav.currentPage === 7"
184+
> v-motion
185+
> :initial="{ x: -80 }"
186+
> :enter="{ x: 0 }">
187+
> Slidev
188+
> </div>
189+
> ```
170190
171191
Learn mode: [Demo](https://sli.dev/demo/starter/7) | [@vueuse/motion](https://motion.vueuse.org/) | [v-motion](https://motion.vueuse.org/directive-usage.html) | [Presets](https://motion.vueuse.org/presets.html)
172192

0 commit comments

Comments
 (0)