diff --git a/docs/.vuepress/theme/components/Navbar.vue b/docs/.vuepress/theme/components/Navbar.vue index 377e4c31684005052fb9bde4a1008dbaa5fa29cf..d9e5ab3e58e2b24f8beef9a30686e7c5f2636290 100644 --- a/docs/.vuepress/theme/components/Navbar.vue +++ b/docs/.vuepress/theme/components/Navbar.vue @@ -166,9 +166,10 @@ export default { }, fixedSideBarHeight () { if(!os.pc) return + const scrollTop = document.documentElement.scrollTop || document.body.scrollTop; this.navbarHeight = this.navbar.clientHeight this.subNavBarHeight = this.subNavBar.clientHeight - const setHeight = this.fixedNavbar ? this.subNavBarHeight : this.navbarHeight + const setHeight = !!scrollTop || this.fixedNavbar ? this.subNavBarHeight : this.navbarHeight this.sideBar.style.top = `${setHeight + 1}px` this.vuepressToc.style.top = `${setHeight + 1}px` },