修改三栏布局为浮动灵活布局
This commit is contained in:
@@ -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';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user