fix: passing a non-array as children to a table will result in an error. (#6521)

* fix: fix table column data is passed into chlidren is undefined or null errorr

* chore(menu): fix menu inline demo watch not trigger
pull/6524/head
Zev Zhu 2 years ago committed by GitHub
parent 3b37cc1ae7
commit 045193e797
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -86,12 +86,9 @@ export default defineComponent({
const titleClick = (e: Event) => {
console.log('titleClick', e);
};
watch(
() => openKeys,
val => {
console.log('openKeys', val);
},
);
watch(openKeys, val => {
console.log('openKeys', val);
});
return {
selectedKeys,
openKeys,

@ -37,7 +37,7 @@ function fillSlots<RecordType>(columns: ColumnsType<RecordType>, contextSlots: R
() => [column.title as any],
);
}
if ('children' in cloneColumn) {
if ('children' in cloneColumn && Array.isArray(cloneColumn.children)) {
cloneColumn.children = fillSlots(cloneColumn.children, contextSlots);
}

Loading…
Cancel
Save