mirror of
https://gitee.com/ant-design-vue/ant-design-vue.git
synced 2024-11-29 18:48:32 +08:00
chore: update getSlot
This commit is contained in:
parent
1836b2e7f4
commit
594256558a
@ -1 +1 @@
|
||||
Subproject commit 8dca2d2cfcaaf970f494ebfb65ee55dfca69870c
|
||||
Subproject commit f9276815b07efeec931404c2cad4e998eba7af14
|
@ -69,7 +69,7 @@ const getSlot = (self, name = 'default', options = {}) => {
|
||||
return (
|
||||
(self.$scopedSlots && self.$scopedSlots[name] && self.$scopedSlots[name](options)) ||
|
||||
self.$slots[name] ||
|
||||
[]
|
||||
undefined
|
||||
);
|
||||
};
|
||||
|
||||
|
@ -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];
|
||||
},
|
||||
};
|
||||
|
@ -378,11 +378,11 @@ export default {
|
||||
},
|
||||
ref: 'trigger',
|
||||
};
|
||||
const children = getSlot(this, 'default')[0];
|
||||
const children = getSlot(this, 'default');
|
||||
return (
|
||||
<Trigger {...triggerProps}>
|
||||
{children &&
|
||||
cloneElement(children, {
|
||||
cloneElement(children[0], {
|
||||
on: {
|
||||
keydown: handleKeyDown,
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user