Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit05a0646

Browse files
authored
fix: make useIsSlideActive() based on useSlideContext().$nav.currentSlideNo instead of useNav().currentSlideNo (#2311)
1 parent044eb3b commit05a0646

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

‎packages/client/logic/slides.ts‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
importtype{SlideRoute}from'@slidev/types'
22
import{slides}from'#slidev/slides'
33
import{computed,watch,watchEffect}from'vue'
4-
import{useNav}from'../composables/useNav'
54
import{useSlideContext}from'../context'
65

76
export{slides}
@@ -24,9 +23,8 @@ export function getSlidePath(
2423
}
2524

2625
exportfunctionuseIsSlideActive(){
27-
const{ $page}=useSlideContext()
28-
const{ currentSlideNo}=useNav()
29-
returncomputed(()=>$page.value===currentSlideNo.value)
26+
const{ $page, $nav}=useSlideContext()
27+
returncomputed(()=>$page.value===$nav.value.currentSlideNo)// Use `$nav.value.currentSlideNo` rather than `useNav().currentSlideNo` to make it work in print/export mode. See https://github.com/slidevjs/slidev/issues/2310.
3028
}
3129

3230
exportfunctiononSlideEnter(cb:()=>void){

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp