Skip to content

Commit

Permalink
fix: ToC link in Presenter Mode (#1936)
Browse files Browse the repository at this point in the history
Co-authored-by: _Kerman <kermanx@qq.com>
  • Loading branch information
rajxsingh and KermanX authored Nov 14, 2024
1 parent feae414 commit b593131
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/client/builtin/TocList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import type { TocItem } from '@slidev/types'
import TitleRenderer from '#slidev/title-renderer'
import { toArray } from '@antfu/utils'
import { computed } from 'vue'
import { useNav } from '../composables/useNav'

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

const { isPresenter } = useNav()

const classes = computed(() => {
return [
...toArray(props.listClass || []),
Expand Down Expand Up @@ -47,7 +50,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 Down

0 comments on commit b593131

Please sign in to comment.