fix(components): [el-table] fixed mode layout misalignment (#4188)

fix #4141
This commit is contained in:
msidolphin 2021-11-05 17:36:05 +08:00 committed by GitHub
parent ff332345f2
commit c72ea9c1a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 6 deletions

View File

@ -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

View File

@ -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

View File

@ -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,