diff --git a/.vitepress/theme/components/DocsSidebar.vue b/.vitepress/theme/components/DocsSidebar.vue index edd9a322..08cb4e65 100644 --- a/.vitepress/theme/components/DocsSidebar.vue +++ b/.vitepress/theme/components/DocsSidebar.vue @@ -54,7 +54,10 @@ function scrollToActiveElement() { watch(() => route.data.relativePath, (newPath, oldPath) => { nextTick(() => { - if (/^(\w*\/)?components\/(?!index.md)/.test(oldPath)) { + if ( + !newPath.includes('components/') + || /^(\w*\/)?components\/(?!index.md)/.test(oldPath) + ) { return }