Skip to content

Commit 045193e

Browse files
authored
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
1 parent 3b37cc1 commit 045193e

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

components/menu/demo/inline.vue

+3-6
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,9 @@ export default defineComponent({
8686
const titleClick = (e: Event) => {
8787
console.log('titleClick', e);
8888
};
89-
watch(
90-
() => openKeys,
91-
val => {
92-
console.log('openKeys', val);
93-
},
94-
);
89+
watch(openKeys, val => {
90+
console.log('openKeys', val);
91+
});
9592
return {
9693
selectedKeys,
9794
openKeys,

components/table/hooks/useColumns.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ function fillSlots<RecordType>(columns: ColumnsType<RecordType>, contextSlots: R
3737
() => [column.title as any],
3838
);
3939
}
40-
if ('children' in cloneColumn) {
40+
if ('children' in cloneColumn && Array.isArray(cloneColumn.children)) {
4141
cloneColumn.children = fillSlots(cloneColumn.children, contextSlots);
4242
}
4343

0 commit comments

Comments
 (0)