【fix 66426】JTable修复拖拽小于最小宽度后的异常

This commit is contained in:
danshihao
2023-03-21 09:08:48 +08:00
parent 7c244fb38e
commit 16bf1499c7
+7 -2
View File
@@ -255,7 +255,7 @@ export default {
return <th {...restProps}>{children}</th>
}
// 开始拖拽监听
const onDrag = (x) => {
const onDragging = (x) => {
const beforeWidth = col.width
const scroll = cloneDeep(this.scroll) || {}
draggingState[key] = 0
@@ -280,6 +280,10 @@ export default {
const onDragstop = () => {
draggingState[key] = thDom.getBoundingClientRect().width
}
// 控制最小拖拽宽度
const onDrag = (x) => {
return x >= (col.minWidth || this.columnMinWidth)
}
return (
<th
{...restProps}
@@ -298,7 +302,8 @@ export default {
axis="x"
draggable={true}
resizable={false}
onDragging={onDrag}
props={{ onDrag }}
onDragging={onDragging}
onDragstop={onDragstop}
></vue-draggable-resizable>
</th>