mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
fix(components): [table-v2] reset lastVisitedColumnIdx if width change (#19757)
fix(components): [table-v2] reset lastVisitedColumnIdx if width change
This commit is contained in:
@@ -1,4 +1,12 @@
|
||||
import { computed, defineComponent, inject, provide, ref, unref } from 'vue'
|
||||
import {
|
||||
computed,
|
||||
defineComponent,
|
||||
inject,
|
||||
provide,
|
||||
ref,
|
||||
unref,
|
||||
watch,
|
||||
} from 'vue'
|
||||
import {
|
||||
DynamicSizeGrid,
|
||||
FixedSizeGrid,
|
||||
@@ -112,6 +120,14 @@ const useTableGrid = (props: TableV2GridProps) => {
|
||||
unref(headerRef)?.$forceUpdate()
|
||||
}
|
||||
|
||||
watch(
|
||||
() => props.bodyWidth,
|
||||
() => {
|
||||
if (isNumber(props.estimatedRowHeight))
|
||||
bodyRef.value?.resetAfter({ columnIndex: 0 }, false)
|
||||
}
|
||||
)
|
||||
|
||||
return {
|
||||
bodyRef,
|
||||
forceUpdate,
|
||||
|
||||
Reference in New Issue
Block a user