Browse Source

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
commit
045193e797
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      components/menu/demo/inline.vue
  2. 2
      components/table/hooks/useColumns.tsx

7
components/menu/demo/inline.vue

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

2
components/table/hooks/useColumns.tsx

@ -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