Skip to content

Commit 61294f0

Browse files
committed
fix(dataTable): rows doesn't update if ref is changed
1 parent b0533fd commit 61294f0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/anu-vue/src/components/data-table/ADataTable.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ defineOptions({
3030
const _tableProps = reactivePick(props, Object.keys(tableProps).filter(k => !['rows', 'cols'].includes(k)) as Array<keyof typeof tableProps>)
3131
3232
const _rows = ref<Record<string, unknown>[]>(typeof props.rows !== 'function' ? props.rows : [])
33+
watchDeep(() => props.rows, val => {
34+
if (Array.isArray(val))
35+
_rows.value = val
36+
})
37+
3338
const _total = ref(typeof props.rows === 'function' ? 0 : props.rows.length)
3439
3540
// SECTION Calculate column

0 commit comments

Comments
 (0)