Skip to content

Commit

Permalink
fix(theme): ssr issues on deno
Browse files Browse the repository at this point in the history
  • Loading branch information
brc-dd committed Aug 20, 2023
1 parent ba825c3 commit e8edd0a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
9 changes: 5 additions & 4 deletions src/client/theme-default/components/VPLocalNav.vue
@@ -1,10 +1,10 @@
<script lang="ts" setup>
import { useWindowScroll } from '@vueuse/core'
import { onContentUpdated } from 'vitepress'
import { computed, shallowRef, ref, onMounted } from 'vue'
import { inBrowser, onContentUpdated } from 'vitepress'
import { computed, onMounted, ref, shallowRef } from 'vue'
import { useData } from '../composables/data'
import { useSidebar } from '../composables/sidebar'
import { getHeaders, type MenuItem } from '../composables/outline'
import { useSidebar } from '../composables/sidebar'
import VPLocalNavOutlineDropdown from './VPLocalNavOutlineDropdown.vue'
import VPIconAlignLeft from './icons/VPIconAlignLeft.vue'
Expand All @@ -18,7 +18,8 @@ defineEmits<{
const { theme, frontmatter } = useData()
const { hasSidebar } = useSidebar()
const { y } = useWindowScroll()
// @ts-ignore
const { y } = useWindowScroll({ window: inBrowser && window })
const headers = shallowRef<MenuItem[]>([])
const navHeight = ref(0)
Expand Down
4 changes: 3 additions & 1 deletion src/client/theme-default/components/VPNavBar.vue
@@ -1,5 +1,6 @@
<script lang="ts" setup>
import { useWindowScroll } from '@vueuse/core'
import { inBrowser } from 'vitepress'
import { ref, watchPostEffect } from 'vue'
import { useData } from '../composables/data'
import { useSidebar } from '../composables/sidebar'
Expand All @@ -20,7 +21,8 @@ defineEmits<{
(e: 'toggle-screen'): void
}>()
const { y } = useWindowScroll()
// @ts-ignore
const { y } = useWindowScroll({ window: inBrowser && window })
const { hasSidebar } = useSidebar()
const { frontmatter } = useData()
Expand Down

0 comments on commit e8edd0a

Please sign in to comment.