修改三栏布局为浮动灵活布局

This commit is contained in:
JoyD
2025-10-23 22:09:49 +08:00
parent 131946b93a
commit 88c90a3afc
3 changed files with 175 additions and 169 deletions

View File

@@ -57,6 +57,12 @@ const props = defineProps({
store: {
type: Object,
required: true
},
// 绝对定位边界(可选):{ x, y, width, height }
bounds: {
type: Object,
required: false,
default: null
}
});
@@ -81,11 +87,24 @@ const containerClasses = computed(() => {
bottom: 'flex border-t border-gray-300 panel-area-bottom'
};
return `${baseClasses} ${positionClasses[props.position]}`;
const absoluteClass = props.bounds ? ' absolute' : '';
return `${baseClasses} ${positionClasses[props.position]}${absoluteClass}`;
});
// 根据位置计算容器样式
const containerStyle = computed(() => {
// 若提供了绝对定位边界则使用top/left/width/height
if (props.bounds) {
const { x = 0, y = 0, width = 0, height = 0 } = props.bounds;
return {
position: 'absolute',
top: `${y}px`,
left: `${x}px`,
width: `${width}px`,
height: `${height}px`
};
}
const isVertical = ['left', 'right'].includes(props.position);
const styleProperty = isVertical ? 'width' : 'height';