Skip to content

Commit b593131

Browse files
rajxsinghkermanx
andauthoredNov 14, 2024··
fix: ToC link in Presenter Mode (#1936)
Co-authored-by: _Kerman <kermanx@qq.com>
1 parent feae414 commit b593131

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed
 

Diff for: ‎packages/client/builtin/TocList.vue

+4-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import type { TocItem } from '@slidev/types'
1111
import TitleRenderer from '#slidev/title-renderer'
1212
import { toArray } from '@antfu/utils'
1313
import { computed } from 'vue'
14+
import { useNav } from '../composables/useNav'
1415

1516
const props = withDefaults(defineProps<{
1617
level: number
@@ -20,6 +21,8 @@ const props = withDefaults(defineProps<{
2021
listClass?: string | string[]
2122
}>(), { level: 1 })
2223

24+
const { isPresenter } = useNav()
25+
2326
const classes = computed(() => {
2427
return [
2528
...toArray(props.listClass || []),
@@ -47,7 +50,7 @@ const styles = computed(() => {
4750
:key="item.path" class="slidev-toc-item"
4851
:class="[{ 'slidev-toc-item-active': item.active }, { 'slidev-toc-item-parent-active': item.activeParent }]"
4952
>
50-
<Link :to="item.path">
53+
<Link :to="isPresenter ? `/presenter${item.path}` : item.path">
5154
<TitleRenderer :no="item.no" />
5255
</Link>
5356
<TocList

0 commit comments

Comments
 (0)