mirror of
https://github.com/element-plus/element-plus.git
synced 2025-01-12 10:45:10 +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 {
|
import {
|
||||||
getKeysMap,
|
getKeysMap,
|
||||||
getRowIdentity,
|
getRowIdentity,
|
||||||
@ -68,6 +68,15 @@ function useWatcher() {
|
|||||||
const sortOrder = ref(null)
|
const sortOrder = ref(null)
|
||||||
const hoverRow = ref(null)
|
const hoverRow = ref(null)
|
||||||
|
|
||||||
|
|
||||||
|
watch(
|
||||||
|
data,
|
||||||
|
() => instance.state && scheduleLayout(false),
|
||||||
|
{
|
||||||
|
deep: true,
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
// 检查 rowKey 是否存在
|
// 检查 rowKey 是否存在
|
||||||
const assertRowKey = () => {
|
const assertRowKey = () => {
|
||||||
if (!rowKey.value) throw new Error('[ElTable] prop row-key is required')
|
if (!rowKey.value) throw new Error('[ElTable] prop row-key is required')
|
||||||
|
Loading…
Reference in New Issue
Block a user