diff --git a/antdv-demo b/antdv-demo index 8dca2d2cf..f9276815b 160000 --- a/antdv-demo +++ b/antdv-demo @@ -1 +1 @@ -Subproject commit 8dca2d2cfcaaf970f494ebfb65ee55dfca69870c +Subproject commit f9276815b07efeec931404c2cad4e998eba7af14 diff --git a/components/_util/props-util.js b/components/_util/props-util.js index 050f634d4..b91bd3619 100644 --- a/components/_util/props-util.js +++ b/components/_util/props-util.js @@ -69,7 +69,7 @@ const getSlot = (self, name = 'default', options = {}) => { return ( (self.$scopedSlots && self.$scopedSlots[name] && self.$scopedSlots[name](options)) || self.$slots[name] || - [] + undefined ); }; diff --git a/components/vc-align/Align.jsx b/components/vc-align/Align.jsx index d853a01d5..a1b6b877c 100644 --- a/components/vc-align/Align.jsx +++ b/components/vc-align/Align.jsx @@ -140,10 +140,10 @@ export default { render() { const { childrenProps } = this.$props; - const child = getSlot(this)[0]; + const child = getSlot(this); if (child && childrenProps) { - return cloneElement(child, { props: childrenProps }); + return cloneElement(child[0], { props: childrenProps }); } - return child; + return child && child[0]; }, }; diff --git a/components/vc-cascader/Cascader.jsx b/components/vc-cascader/Cascader.jsx index a290768c5..198abc12d 100644 --- a/components/vc-cascader/Cascader.jsx +++ b/components/vc-cascader/Cascader.jsx @@ -378,11 +378,11 @@ export default { }, ref: 'trigger', }; - const children = getSlot(this, 'default')[0]; + const children = getSlot(this, 'default'); return ( {children && - cloneElement(children, { + cloneElement(children[0], { on: { keydown: handleKeyDown, },