20260817172952
This commit is contained in:
1 parent
4ef678ba65
commit
5bbd3c88b4
1865 files changed
+2261
-901
No files matched your search
@@ -142,6 +142,19 @@ function applySizes(result, index) {
|
||||
innerSizes.value = next
|
||||
}
|
||||
|
||||
// 拖拽/键盘调整结束后,未显式声明尺寸(无 size 且无 defaultSize)的面板恢复为
|
||||
// flex 自动填充,避免其被固定为拖拽时的 px 宽度,导致容器尺寸变化
|
||||
// (如侧栏折叠、窗口缩放)时剩余空间无法被自动填满
|
||||
function releaseAutoPanels() {
|
||||
const next = [...innerSizes.value]
|
||||
panelItems.value.forEach((panel, i) => {
|
||||
if (next[i] !== undefined && panel.props.size == null && panel.props.defaultSize == null) {
|
||||
delete next[i]
|
||||
}
|
||||
})
|
||||
innerSizes.value = next
|
||||
}
|
||||
|
||||
function onBarPointerDown(index, event) {
|
||||
if (event.button !== 0 || !canResize(index)) return
|
||||
event.preventDefault()
|
||||
@@ -195,6 +208,7 @@ function onPointerUp() {
|
||||
document.body.style.webkitUserSelect = ''
|
||||
window.removeEventListener('pointermove', onPointerMove)
|
||||
window.removeEventListener('pointerup', onPointerUp)
|
||||
releaseAutoPanels()
|
||||
emit('resize-end', finalSizes)
|
||||
}
|
||||
|
||||
@@ -216,6 +230,7 @@ function onBarKeydown(index, event) {
|
||||
const startSizes = measurePanelSizes()
|
||||
const result = applyOffset(index, startSizes, container, delta)
|
||||
applySizes(result, index)
|
||||
releaseAutoPanels()
|
||||
emit('resize', [...result])
|
||||
emit('resize-end', [...result])
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user