File tree 2 files changed +8
-5
lines changed
src/client/theme-default/components
2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change 1
1
<script lang="ts" setup>
2
2
import { useWindowScroll } from ' @vueuse/core'
3
- import { onContentUpdated } from ' vitepress'
4
- import { computed , shallowRef , ref , onMounted } from ' vue'
3
+ import { inBrowser , onContentUpdated } from ' vitepress'
4
+ import { computed , onMounted , ref , shallowRef } from ' vue'
5
5
import { useData } from ' ../composables/data'
6
- import { useSidebar } from ' ../composables/sidebar'
7
6
import { getHeaders , type MenuItem } from ' ../composables/outline'
7
+ import { useSidebar } from ' ../composables/sidebar'
8
8
import VPLocalNavOutlineDropdown from ' ./VPLocalNavOutlineDropdown.vue'
9
9
import VPIconAlignLeft from ' ./icons/VPIconAlignLeft.vue'
10
10
@@ -18,7 +18,8 @@ defineEmits<{
18
18
19
19
const { theme, frontmatter } = useData ()
20
20
const { hasSidebar } = useSidebar ()
21
- const { y } = useWindowScroll ()
21
+ // @ts-ignore
22
+ const { y } = useWindowScroll ({ window: inBrowser && window })
22
23
23
24
const headers = shallowRef <MenuItem []>([])
24
25
const navHeight = ref (0 )
Original file line number Diff line number Diff line change 1
1
<script lang="ts" setup>
2
2
import { useWindowScroll } from ' @vueuse/core'
3
+ import { inBrowser } from ' vitepress'
3
4
import { ref , watchPostEffect } from ' vue'
4
5
import { useData } from ' ../composables/data'
5
6
import { useSidebar } from ' ../composables/sidebar'
@@ -20,7 +21,8 @@ defineEmits<{
20
21
(e : ' toggle-screen' ): void
21
22
}>()
22
23
23
- const { y } = useWindowScroll ()
24
+ // @ts-ignore
25
+ const { y } = useWindowScroll ({ window: inBrowser && window })
24
26
const { hasSidebar } = useSidebar ()
25
27
const { frontmatter } = useData ()
26
28
You can’t perform that action at this time.
0 commit comments