fix: throw exception when has none collapse-panel in default slot (#1116)
parent
095406eea6
commit
62e3c4b73a
|
@ -70,6 +70,7 @@ export default {
|
||||||
const activeKey = this.stateActiveKey;
|
const activeKey = this.stateActiveKey;
|
||||||
const { prefixCls, accordion, destroyInactivePanel, expandIcon } = this.$props;
|
const { prefixCls, accordion, destroyInactivePanel, expandIcon } = this.$props;
|
||||||
const newChildren = [];
|
const newChildren = [];
|
||||||
|
if (this.$slots.default) {
|
||||||
this.$slots.default.forEach((child, index) => {
|
this.$slots.default.forEach((child, index) => {
|
||||||
if (isEmptyElement(child)) return;
|
if (isEmptyElement(child)) return;
|
||||||
const { header, headerClass, disabled } = getPropsData(child);
|
const { header, headerClass, disabled } = getPropsData(child);
|
||||||
|
@ -108,6 +109,7 @@ export default {
|
||||||
|
|
||||||
newChildren.push(cloneElement(child, props));
|
newChildren.push(cloneElement(child, props));
|
||||||
});
|
});
|
||||||
|
}
|
||||||
return newChildren;
|
return newChildren;
|
||||||
},
|
},
|
||||||
setActiveKey(activeKey) {
|
setActiveKey(activeKey) {
|
||||||
|
|
Loading…
Reference in New Issue