diff --git a/docs/.vitepress/config/en.mts b/docs/.vitepress/config/en.mts index 2a986994..b598bece 100644 --- a/docs/.vitepress/config/en.mts +++ b/docs/.vitepress/config/en.mts @@ -133,12 +133,19 @@ function sidebarCommercial(): DefaultTheme.SidebarItem[] { function nav(): DefaultTheme.NavItem[] { return [ { + activeMatch: '^/en/(guide|components)/', text: 'Doc', items: [ { + activeMatch: '^/en/guide/', link: '/en/guide/introduction/vben', text: 'Guide', }, + // { + // activeMatch: '^/en/components/', + // link: '/en/components/introduction', + // text: 'Components', + // }, { text: 'Historical Versions', items: [ diff --git a/docs/.vitepress/config/zh.mts b/docs/.vitepress/config/zh.mts index bb054217..ff0f2256 100644 --- a/docs/.vitepress/config/zh.mts +++ b/docs/.vitepress/config/zh.mts @@ -176,13 +176,16 @@ function sidebarComponents(): DefaultTheme.SidebarItem[] { function nav(): DefaultTheme.NavItem[] { return [ { + activeMatch: '^/(guide|components)/', text: '文档', items: [ { + activeMatch: '^/guide/', link: '/guide/introduction/vben', text: '指南', }, { + activeMatch: '^/components/', link: '/components/introduction', text: '组件', }, diff --git a/docs/.vitepress/theme/styles/base.css b/docs/.vitepress/theme/styles/base.css index 6b07258a..8eb423af 100644 --- a/docs/.vitepress/theme/styles/base.css +++ b/docs/.vitepress/theme/styles/base.css @@ -9,3 +9,14 @@ html.dark { .form-valid-error p { margin: 0; } + +/* 顶部导航栏选中项样式 */ +.VPNavBarMenuLink, +.VPNavBarMenuGroup { + border-bottom: 1px solid transparent; +} + +.VPNavBarMenuLink.active, +.VPNavBarMenuGroup.active { + border-bottom-color: var(--vp-c-brand-1); +}