chore: update getSlot
parent
1836b2e7f4
commit
594256558a
|
@ -1 +1 @@
|
||||||
Subproject commit 8dca2d2cfcaaf970f494ebfb65ee55dfca69870c
|
Subproject commit f9276815b07efeec931404c2cad4e998eba7af14
|
|
@ -69,7 +69,7 @@ const getSlot = (self, name = 'default', options = {}) => {
|
||||||
return (
|
return (
|
||||||
(self.$scopedSlots && self.$scopedSlots[name] && self.$scopedSlots[name](options)) ||
|
(self.$scopedSlots && self.$scopedSlots[name] && self.$scopedSlots[name](options)) ||
|
||||||
self.$slots[name] ||
|
self.$slots[name] ||
|
||||||
[]
|
undefined
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -140,10 +140,10 @@ export default {
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { childrenProps } = this.$props;
|
const { childrenProps } = this.$props;
|
||||||
const child = getSlot(this)[0];
|
const child = getSlot(this);
|
||||||
if (child && childrenProps) {
|
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',
|
ref: 'trigger',
|
||||||
};
|
};
|
||||||
const children = getSlot(this, 'default')[0];
|
const children = getSlot(this, 'default');
|
||||||
return (
|
return (
|
||||||
<Trigger {...triggerProps}>
|
<Trigger {...triggerProps}>
|
||||||
{children &&
|
{children &&
|
||||||
cloneElement(children, {
|
cloneElement(children[0], {
|
||||||
on: {
|
on: {
|
||||||
keydown: handleKeyDown,
|
keydown: handleKeyDown,
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue