fix(theme): ssr issues on deno

pull/2495/merge
Divyansh Singh 1 year ago
parent ba825c3032
commit e8edd0a05f

@ -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'
@ -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)

@ -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'
@ -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()

Loading…
Cancel
Save