fix: shake when adding tabs

This commit is contained in:
vince
2024-07-16 22:07:28 +08:00
parent 9021e992ad
commit c2c32332d3
16 changed files with 256 additions and 226 deletions

View File

@@ -219,9 +219,12 @@ const maskVisible = computed(() => !sidebarCollapse.value && props.isMobile);
* header fixed值
*/
const headerFixed = computed(() => {
const { headerMode } = props;
return (
isMixedNav.value ||
['auto', 'auto-scroll', 'fixed'].includes(props.headerMode)
headerMode === 'fixed' ||
headerMode === 'auto-scroll' ||
headerMode === 'auto'
);
});
@@ -230,7 +233,8 @@ const mainStyle = computed(() => {
let sidebarAndExtraWidth = 'unset';
if (
headerFixed.value &&
!['header-nav', 'mixed-nav'].includes(realLayout.value) &&
realLayout.value !== 'header-nav' &&
realLayout.value !== 'mixed-nav' &&
showSidebar.value &&
!props.isMobile
) {
@@ -272,16 +276,9 @@ const tabbarStyle = computed((): CSSProperties => {
if (!isMixedNav.value) {
width = '100%';
} else if (sidebarEnable.value) {
const hoverWidth =
sidebarExpandOnHovering.value && !sidebarExpandOnHover.value
? props.sidebarWidth
: getSideCollapseWidth.value;
const runtimeWidth = isMixedNav.value ? hoverWidth : props.sidebarWidth;
marginLeft = sidebarCollapse.value
? getSideCollapseWidth.value
: runtimeWidth;
: props.sidebarWidth;
width = `calc(100% - ${getSidebarWidth.value}px)`;
} else {