diff --git a/src/components/common/Header/index.astro b/src/components/common/Header/index.astro index b5c3c12e5bb..526368d8ca4 100644 --- a/src/components/common/Header/index.astro +++ b/src/components/common/Header/index.astro @@ -52,7 +52,7 @@ let height, width, xpadding = "";
- +
diff --git a/src/components/common/Navbar.astro b/src/components/common/Navbar.astro index 9f175428b1b..9cd6accd0ec 100644 --- a/src/components/common/Navbar.astro +++ b/src/components/common/Navbar.astro @@ -8,7 +8,9 @@ const ifzh = isChinese(Astro); interface Props { class?: string; + top?: "4rem" | "3.5rem"; } +const { top = '4rem' } = Astro.props; // 修改 文档 菜单显示逻辑 const lastIdx = dataSource.length - 1; @@ -92,6 +94,7 @@ const ifactive = (toggle) => { slot={slot} target={target} position={position} + top={top} class={`item ${index === lastIdx ? 'item-last-child' : ''}`} > diff --git a/src/components/common/Toggle.astro b/src/components/common/Toggle.astro index 33a146c0229..1d990071745 100644 --- a/src/components/common/Toggle.astro +++ b/src/components/common/Toggle.astro @@ -10,10 +10,11 @@ interface Props { slot?: HTMLElement; // 如果下拉窗口内容比较多,可以相对视图定位,自定义下拉内容 position?: 'absolute' | 'fixed'; + top?: "4rem" | "3.5rem"; showArrow?: boolean; } -const { title, trigger = "hover", route = '', slot, position = 'absolute', active = false, showArrow = true, target = '_self' } = Astro.props; +const { title, trigger = "hover", route = '', slot, position = 'absolute', active = false, showArrow = true, target = '_self', top = '4rem' } = Astro.props; const ifdropdown = slot && !route; const Component = slot; @@ -118,7 +119,7 @@ const Component = slot; -