mirror of
https://github.com/element-plus/element-plus.git
synced 2025-01-18 10:59:10 +08:00
fix(components): [el-table] fixed mode layout misalignment (#4188)
fix #4141
This commit is contained in:
parent
ff332345f2
commit
c72ea9c1a1
@ -32,7 +32,6 @@ function useRender<T>(props: Partial<TableBodyProps<T>>) {
|
||||
getCellClass,
|
||||
getSpan,
|
||||
getColspanRealWidth,
|
||||
isColumnHidden,
|
||||
} = useStyles(props)
|
||||
const firstDefaultColumnIndex = computed(() => {
|
||||
return props.store.states.columns.value.findIndex(
|
||||
@ -127,7 +126,7 @@ function useRender<T>(props: Partial<TableBodyProps<T>>) {
|
||||
)
|
||||
}
|
||||
const cellChildren = (cellIndex, column, data) => {
|
||||
return isColumnHidden(cellIndex) ? null : column.renderCell(data)
|
||||
return column.renderCell(data)
|
||||
}
|
||||
const wrappedRowRender = (row: T, $index: number) => {
|
||||
const store = props.store
|
||||
|
@ -83,8 +83,9 @@ function useEvent<T>(props: TableHeaderProps<T>, emit) {
|
||||
column,
|
||||
event
|
||||
)
|
||||
props.store.scheduleLayout(false, true)
|
||||
|
||||
requestAnimationFrame(() => {
|
||||
props.store.scheduleLayout(false, true)
|
||||
})
|
||||
document.body.style.cursor = ''
|
||||
dragging.value = false
|
||||
draggingColumn.value = null
|
||||
|
@ -100,14 +100,14 @@ function useStyle<T>(
|
||||
layout.updateElsHeight()
|
||||
}
|
||||
layout.updateColumnsWidth()
|
||||
syncPostion()
|
||||
requestAnimationFrame(syncPostion)
|
||||
}
|
||||
onMounted(async () => {
|
||||
setScrollClass('is-scrolling-left')
|
||||
store.updateColumns()
|
||||
await nextTick()
|
||||
bindEvents()
|
||||
doLayout()
|
||||
requestAnimationFrame(doLayout)
|
||||
|
||||
resizeState.value = {
|
||||
width: table.vnode.el.offsetWidth,
|
||||
|
Loading…
Reference in New Issue
Block a user