【fix 66426】JTable修复拖拽小于最小宽度后的异常
This commit is contained in:
@@ -255,7 +255,7 @@ export default {
|
|||||||
return <th {...restProps}>{children}</th>
|
return <th {...restProps}>{children}</th>
|
||||||
}
|
}
|
||||||
// 开始拖拽监听
|
// 开始拖拽监听
|
||||||
const onDrag = (x) => {
|
const onDragging = (x) => {
|
||||||
const beforeWidth = col.width
|
const beforeWidth = col.width
|
||||||
const scroll = cloneDeep(this.scroll) || {}
|
const scroll = cloneDeep(this.scroll) || {}
|
||||||
draggingState[key] = 0
|
draggingState[key] = 0
|
||||||
@@ -280,6 +280,10 @@ export default {
|
|||||||
const onDragstop = () => {
|
const onDragstop = () => {
|
||||||
draggingState[key] = thDom.getBoundingClientRect().width
|
draggingState[key] = thDom.getBoundingClientRect().width
|
||||||
}
|
}
|
||||||
|
// 控制最小拖拽宽度
|
||||||
|
const onDrag = (x) => {
|
||||||
|
return x >= (col.minWidth || this.columnMinWidth)
|
||||||
|
}
|
||||||
return (
|
return (
|
||||||
<th
|
<th
|
||||||
{...restProps}
|
{...restProps}
|
||||||
@@ -298,7 +302,8 @@ export default {
|
|||||||
axis="x"
|
axis="x"
|
||||||
draggable={true}
|
draggable={true}
|
||||||
resizable={false}
|
resizable={false}
|
||||||
onDragging={onDrag}
|
props={{ onDrag }}
|
||||||
|
onDragging={onDragging}
|
||||||
onDragstop={onDragstop}
|
onDragstop={onDragstop}
|
||||||
></vue-draggable-resizable>
|
></vue-draggable-resizable>
|
||||||
</th>
|
</th>
|
||||||
|
|||||||
Reference in New Issue
Block a user