fix: tabbar does not meet expectations in a mixed layout (#4242)

This commit is contained in:
Vben
2024-08-26 22:58:49 +08:00
committed by GitHub
parent 87cc8a154c
commit dc5cfab319
4 changed files with 6 additions and 5 deletions

View File

@@ -242,7 +242,7 @@ const tabbarStyle = computed((): CSSProperties => {
let marginLeft = 0;
// 如果不是混合导航tabbar 的宽度为 100%
if (!isMixedNav.value) {
if (!isMixedNav.value || props.sidebarHidden) {
width = '100%';
} else if (sidebarEnable.value) {
// 鼠标在侧边栏上时,且侧边栏展开时的宽度

View File

@@ -73,6 +73,7 @@ export function useTabsViewScroll(props: TabsProps) {
resizeObserver = new ResizeObserver(
useDebounceFn((_entries: ResizeObserverEntry[]) => {
calcShowScrollbarButton();
scrollToActiveIntoView();
}, 100),
);
resizeObserver.observe(viewportEl);