mirror of
https://github.com/element-plus/element-plus.git
synced 2024-12-27 03:01:14 +08:00
fix(table): when the data changes, the table does not update the layout (#1315)
This commit is contained in:
parent
b85758912a
commit
9a4beb0105
@ -1,4 +1,4 @@
|
||||
import { ref, getCurrentInstance, unref } from 'vue'
|
||||
import { ref, getCurrentInstance, unref, watch } from 'vue'
|
||||
import {
|
||||
getKeysMap,
|
||||
getRowIdentity,
|
||||
@ -68,6 +68,15 @@ function useWatcher() {
|
||||
const sortOrder = ref(null)
|
||||
const hoverRow = ref(null)
|
||||
|
||||
|
||||
watch(
|
||||
data,
|
||||
() => instance.state && scheduleLayout(false),
|
||||
{
|
||||
deep: true,
|
||||
},
|
||||
)
|
||||
|
||||
// 检查 rowKey 是否存在
|
||||
const assertRowKey = () => {
|
||||
if (!rowKey.value) throw new Error('[ElTable] prop row-key is required')
|
||||
|
Loading…
Reference in New Issue
Block a user