Description
First of all thanks for the work put on this project 👏
Context
I wanted to create a vue computed function useBreadcrumb
that based on tocTree
and currentSlideNo
from useNav()
give back the array of titles to be able to render a breadcrumb on each slides. Final goal was to release an add-on.
Describe the bug
When I use the following approach to display the current slide number, it's working well in the webview but during the export to pdf the value is always 1
:
<script>
import { useNav } from '@slidev/client'
const { currentSlideNo } = useNav()
</script>
<template>
{{ currentSlideNo }}
</template>
I don't have this issue when I use directly $nav.currentSlideNo
.
Minimal reproduction
I created a minimal reproductible example at https://github.com/johannchopin/slidev-currentSlideNo-bug-in-pdf. In the global-bottom.vue file I display the value of $nav.currentSlideNo
and the SlideNo.vue component render the currentSlideNo
value. The result can be see in the exported PDF slides-export.pdf.
Environment
- Slidev version: Used
@slidev/cli@^0.49.20
to generate the dummy repo - Browser: Chrome
- OS: Windows