diff --git a/.vitepress/theme/components/DocAsideItem.vue b/.vitepress/theme/components/DocAsideItem.vue index f6c7d82..649c8ef 100644 --- a/.vitepress/theme/components/DocAsideItem.vue +++ b/.vitepress/theme/components/DocAsideItem.vue @@ -11,7 +11,7 @@ defineProps<{ function onClick({ target: el }: Event) { const id = (el as HTMLAnchorElement).href!.split('#')[1] - const heading = document.getElementById(decodeURIComponent(id)) + const heading = globalThis.document?.getElementById(decodeURIComponent(id)) heading?.focus({ preventScroll: true }) } diff --git a/.vitepress/theme/components/Sidebar.vue b/.vitepress/theme/components/Sidebar.vue index 0919029..7eb0b82 100644 --- a/.vitepress/theme/components/Sidebar.vue +++ b/.vitepress/theme/components/Sidebar.vue @@ -14,7 +14,7 @@ const { sidebarGroups, hasSidebar } = useSidebar() as unknown as { sidebarGroups // a11y: focus Nav element when menu has opened const navEl = ref(null) -const isLocked = useScrollLock(inBrowser ? document.body : null) +const isLocked = useScrollLock(inBrowser ? globalThis.document.body : null) watch( [props, navEl], @@ -66,7 +66,7 @@ function onSectionTitleClicked(i: number) { diff --git a/.vitepress/theme/components/header/ThemeSwitcher.vue b/.vitepress/theme/components/header/ThemeSwitcher.vue index 272adcc..55c2d81 100644 --- a/.vitepress/theme/components/header/ThemeSwitcher.vue +++ b/.vitepress/theme/components/header/ThemeSwitcher.vue @@ -1,4 +1,6 @@