mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-13 17:05:47 +08:00
fix(table): when the data changes, the layout is not updated (#1059)
Co-authored-by: winerlu <winerlu@tencent.com>
This commit is contained in:
parent
beb1270414
commit
d54abc800a
@ -37,8 +37,10 @@ function useStore(): Store {
|
||||
}
|
||||
}
|
||||
instance.store.updateAllSelected()
|
||||
|
||||
instance.store.updateTableScrollY()
|
||||
if (instance.$ready) {
|
||||
instance.store.scheduleLayout()
|
||||
}
|
||||
},
|
||||
|
||||
insertColumn(states, column, index, parent) {
|
||||
@ -150,7 +152,7 @@ function useStore(): Store {
|
||||
instance.store.updateCurrentRow(row)
|
||||
},
|
||||
}
|
||||
const commit = function (name, ...args) {
|
||||
const commit = function(name, ...args) {
|
||||
const mutations = instance.store.mutations
|
||||
if (mutations[name]) {
|
||||
mutations[name].apply(instance, [instance.store.states].concat(args))
|
||||
@ -158,8 +160,8 @@ function useStore(): Store {
|
||||
throw new Error(`Action not found: ${name}`)
|
||||
}
|
||||
}
|
||||
const updateTableScrollY = function () {
|
||||
nextTick(instance.layout.updateScrollY.apply(instance.layout))
|
||||
const updateTableScrollY = function() {
|
||||
nextTick(() => instance.layout.updateScrollY.apply(instance.layout))
|
||||
}
|
||||
const watcher = useWatcher()
|
||||
return {
|
||||
|
Loading…
Reference in New Issue
Block a user