mirror of
https://github.com/element-plus/element-plus.git
synced 2024-11-21 01:02:59 +08:00
fix(components): [table] the last column shuld not allow drag (#18444)
This commit is contained in:
parent
1f82e8ca61
commit
ed9bb12ef8
@ -121,13 +121,14 @@ function useEvent<T>(props: TableHeaderProps<T>, emit) {
|
||||
}
|
||||
const target = el?.closest('th')
|
||||
|
||||
if (!column || !column.resizable) return
|
||||
if (!column || !column.resizable || !target) return
|
||||
|
||||
if (!dragging.value && props.border) {
|
||||
const rect = target.getBoundingClientRect()
|
||||
|
||||
const bodyStyle = document.body.style
|
||||
if (rect.width > 12 && rect.right - event.pageX < 8) {
|
||||
const isLastTh = target.parentNode?.lastElementChild === target
|
||||
if (rect.width > 12 && rect.right - event.pageX < 8 && !isLastTh) {
|
||||
bodyStyle.cursor = 'col-resize'
|
||||
if (hasClass(target, 'is-sortable')) {
|
||||
target.style.cursor = 'col-resize'
|
||||
|
Loading…
Reference in New Issue
Block a user