|
|
@ -92,7 +92,7 @@ const props = withDefaults(defineProps<Props>(), { |
|
|
domVisible: true, |
|
|
domVisible: true, |
|
|
extraWidth: 180, |
|
|
extraWidth: 180, |
|
|
fixedExtra: false, |
|
|
fixedExtra: false, |
|
|
isSideMixed: false, |
|
|
isSidebarMixed: false, |
|
|
mixedWidth: 80, |
|
|
mixedWidth: 80, |
|
|
paddingTop: 60, |
|
|
paddingTop: 60, |
|
|
show: true, |
|
|
show: true, |
|
|
@ -118,13 +118,13 @@ const hiddenSideStyle = computed((): CSSProperties => { |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
const style = computed((): CSSProperties => { |
|
|
const style = computed((): CSSProperties => { |
|
|
const { isSideMixed, paddingTop, zIndex } = props; |
|
|
const { isSidebarMixed, paddingTop, zIndex } = props; |
|
|
|
|
|
|
|
|
return { |
|
|
return { |
|
|
...calcMenuWidthStyle(false), |
|
|
...calcMenuWidthStyle(false), |
|
|
paddingTop: `${paddingTop}px`, |
|
|
paddingTop: `${paddingTop}px`, |
|
|
zIndex, |
|
|
zIndex, |
|
|
...(isSideMixed && extraVisible.value ? { transition: 'none' } : {}), |
|
|
...(isSidebarMixed && extraVisible.value ? { transition: 'none' } : {}), |
|
|
}; |
|
|
}; |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
@ -147,8 +147,8 @@ const extraTitleStyle = computed((): CSSProperties => { |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
const contentWidthStyle = computed((): CSSProperties => { |
|
|
const contentWidthStyle = computed((): CSSProperties => { |
|
|
const { collapseWidth, fixedExtra, isSideMixed, mixedWidth } = props; |
|
|
const { collapseWidth, fixedExtra, isSidebarMixed, mixedWidth } = props; |
|
|
if (isSideMixed && fixedExtra) { |
|
|
if (isSidebarMixed && fixedExtra) { |
|
|
return { width: `${collapse.value ? collapseWidth : mixedWidth}px` }; |
|
|
return { width: `${collapse.value ? collapseWidth : mixedWidth}px` }; |
|
|
} |
|
|
} |
|
|
return {}; |
|
|
return {}; |
|
|
@ -165,10 +165,10 @@ const contentStyle = computed((): CSSProperties => { |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
const headerStyle = computed((): CSSProperties => { |
|
|
const headerStyle = computed((): CSSProperties => { |
|
|
const { headerHeight, isSideMixed } = props; |
|
|
const { headerHeight, isSidebarMixed } = props; |
|
|
|
|
|
|
|
|
return { |
|
|
return { |
|
|
...(isSideMixed ? { display: 'flex', justifyContent: 'center' } : {}), |
|
|
...(isSidebarMixed ? { display: 'flex', justifyContent: 'center' } : {}), |
|
|
height: `${headerHeight}px`, |
|
|
height: `${headerHeight}px`, |
|
|
...contentWidthStyle.value, |
|
|
...contentWidthStyle.value, |
|
|
}; |
|
|
}; |
|
|
@ -195,10 +195,16 @@ watchEffect(() => { |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
function calcMenuWidthStyle(isHiddenDom: boolean): CSSProperties { |
|
|
function calcMenuWidthStyle(isHiddenDom: boolean): CSSProperties { |
|
|
const { backgroundColor, extraWidth, fixedExtra, isSideMixed, show, width } = |
|
|
const { |
|
|
props; |
|
|
backgroundColor, |
|
|
|
|
|
extraWidth, |
|
|
let widthValue = `${width + (isSideMixed && fixedExtra && extraVisible.value ? extraWidth : 0)}px`; |
|
|
fixedExtra, |
|
|
|
|
|
isSidebarMixed, |
|
|
|
|
|
show, |
|
|
|
|
|
width, |
|
|
|
|
|
} = props; |
|
|
|
|
|
|
|
|
|
|
|
let widthValue = `${width + (isSidebarMixed && fixedExtra && extraVisible.value ? extraWidth : 0)}px`; |
|
|
|
|
|
|
|
|
const { collapseWidth } = props; |
|
|
const { collapseWidth } = props; |
|
|
|
|
|
|
|
|
|