diff --git a/src/components/container/TableHeaderTh.vue b/src/components/container/TableHeaderTh.vue index 4802782..43eec5e 100644 --- a/src/components/container/TableHeaderTh.vue +++ b/src/components/container/TableHeaderTh.vue @@ -1,12 +1,7 @@ @@ -48,17 +49,21 @@ while (curColumn.value.children?.length > 0) { const index = curColumn.value.node.props.__index; const headerRef = ref(null) as Ref; -onResizeTableColumn(headerRef, { +const resizeLineRef = ref(null) as Ref; +onResizeTableColumn(resizeLineRef, { onEnd: x => { + const headerLeft = headerRef.value?.offsetLeft ?? 0; + $slotsBox.tableHeaders.leafs[index].width = Math.max( - $slotsBox.tableHeaders.leafs[index].width + x, + $slotsBox.tableHeaders.leafs[index].width + x - headerLeft, Variables.size.minTableColumnWidth ); }, preMove: x => { + const headerLeft = headerRef.value?.offsetLeft ?? 0; if ( - $slotsBox.tableHeaders.leafs[index].width + x < + $slotsBox.tableHeaders.leafs[index].width + x - headerLeft < Variables.size.minTableColumnWidth ) return false; @@ -90,7 +95,6 @@ const titleProps = props.column.isLeaf border-right: 1px solid #e5e5e5; padding: 0 12px; font-size: 14px; - pointer-events: none; } .xg-table-header-cell-resizable { @@ -102,7 +106,6 @@ const titleProps = props.column.isLeaf bottom: 0; width: 10px; cursor: col-resize; - pointer-events: auto; } }