Replies: 3 comments
-
OK, I tried to something like: <script setup lang="ts">
const { toc, page } = useContent();
const pageElement = page.value.body.children;
</script>
<div v-for="(element, idx) in pageElement" :key="element._path">
<div
class="slide-enter"
:style="{
'--enter-stage': idx,
'--enter-step': '60ms',
}"
>
<ContentRenderer :value="element" />
</div>
</div> Then
How to make the |
Beta Was this translation helpful? Give feedback.
-
This might be similar to my other question when parsing In general, I think I'm need some background knowledge of how to "unwrap" or "rewrap" reactive or nuxt-parsed object. |
Beta Was this translation helpful? Give feedback.
-
I also discovered the API |
Beta Was this translation helpful? Give feedback.
-
I'm trying to do a "slide enter" effect for my markdown post, where it is described here: https://antfu.me/posts/sliding-enter-animation
The problem arise when I try to use
ContentRender
to load the content of the page (document-driven mode)To make the slide-effect work, I need to assign for the sub-element, i.e.
h2
,h3
,p
, when to do the effect -- this needs me to get the "index" for them, which I can usually done byv-for
in normal scenarios...The question is, how (or is it possible) to achieve it with the
ContentRender
api?Beta Was this translation helpful? Give feedback.
All reactions