From 38f25da700b8305e910f3b61cddb4803d53adfea Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=BC=A0=E7=91=9E?= <2896402717@qq.com>
Date: Fri, 29 Nov 2024 01:34:37 +0800
Subject: [PATCH 1/5] fix(components):Local navigation location error
---
.../components/VPLocalNavOutlineDropdown.vue | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/client/theme-default/components/VPLocalNavOutlineDropdown.vue b/src/client/theme-default/components/VPLocalNavOutlineDropdown.vue
index ad6386cc..5b14cdd4 100644
--- a/src/client/theme-default/components/VPLocalNavOutlineDropdown.vue
+++ b/src/client/theme-default/components/VPLocalNavOutlineDropdown.vue
@@ -1,10 +1,11 @@
From b00e2bf548f41979d062b7705e99ffe2a08c12a6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=BC=A0=E7=91=9E?= <2896402717@qq.com>
Date: Thu, 16 Jan 2025 22:58:08 +0800
Subject: [PATCH 2/5] fix(components):update
---
.../components/VPLocalNavOutlineDropdown.vue | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/client/theme-default/components/VPLocalNavOutlineDropdown.vue b/src/client/theme-default/components/VPLocalNavOutlineDropdown.vue
index 5b14cdd4..526a196e 100644
--- a/src/client/theme-default/components/VPLocalNavOutlineDropdown.vue
+++ b/src/client/theme-default/components/VPLocalNavOutlineDropdown.vue
@@ -17,6 +17,7 @@ const open = ref(false)
const vh = ref(0)
const main = ref()
const items = ref()
+const {hasSidebar} = useSidebar()
function closeOnClickOutside(e: Event) {
if (!main.value?.contains(e.target as Node)) {
@@ -61,13 +62,6 @@ function scrollToTop() {
open.value = false
window.scrollTo({ top: 0, left: 0, behavior: 'smooth' })
}
-
-onMounted(()=>{
- const {hasSidebar} = useSidebar()
- if(!hasSidebar.value){
- document.documentElement.style.setProperty("--vp-sidebar-width","0px")
- }
-})
@@ -75,6 +69,9 @@ onMounted(()=>{
class="VPLocalNavOutlineDropdown"
:style="{ '--vp-vh': vh + 'px' }"
ref="main"
+ :class="{
+ 'has-sidebar': hasSidebar,
+ }"
>