Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ToC link in Presenter Mode #1936

Merged
merged 4 commits into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/client/builtin/Toc.vue
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ const toc = computed(() => {
:list-style="listStyle"
:list="toc"
:list-class="listClass"
:is-presenter="$slidev.nav.isPresenter"
/>
</div>
</template>
4 changes: 3 additions & 1 deletion packages/client/builtin/TocList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const props = withDefaults(defineProps<{
listStyle?: string | string[]
list: TocItem[]
listClass?: string | string[]
isPresenter: boolean
}>(), { level: 1 })

const classes = computed(() => {
Expand Down Expand Up @@ -47,7 +48,7 @@ const styles = computed(() => {
:key="item.path" class="slidev-toc-item"
:class="[{ 'slidev-toc-item-active': item.active }, { 'slidev-toc-item-parent-active': item.activeParent }]"
>
<Link :to="item.path">
<Link :to="isPresenter ? `/presenter${item.path}` : item.path">
<TitleRenderer :no="item.no" />
</Link>
<TocList
Expand All @@ -56,6 +57,7 @@ const styles = computed(() => {
:list-style="listStyle"
:list="item.children"
:list-class="listClass"
:is-presenter="isPresenter"
/>
</li>
</ol>
Expand Down
Loading