fix(components): [table] fixed column style when lazyload title (#19020)

This commit is contained in:
btea 2024-11-27 10:26:10 +08:00 committed by GitHub
parent 8df0d61f38
commit a2f43777c3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -6,7 +6,9 @@ import {
inject,
nextTick,
onMounted,
reactive,
ref,
watch,
} from 'vue'
import ElCheckbox from '@element-plus/components/checkbox'
import { useNamespace } from '@element-plus/hooks'
@ -69,7 +71,7 @@ export default defineComponent({
const { onColumnsChange, onScrollableChange } = useLayoutObserver(parent!)
const isTableLayoutAuto = parent?.props.tableLayout === 'auto'
const saveIndexSelection = new Map()
const saveIndexSelection = reactive(new Map())
const theadRef = ref()
const updateFixedColumnStyle = () => {
@ -89,6 +91,8 @@ export default defineComponent({
})
}
watch(saveIndexSelection, updateFixedColumnStyle)
onMounted(async () => {
// Need double await, because updateColumns is executed after nextTick for now
await nextTick()