Dropdown: fix dropdown组件下的插槽,设置了'#default'属性,不显示下拉框(#22283)

pull/22285/head
许金泰 2022-11-26 02:53:32 +08:00
parent fa18776b4b
commit f91c327490
1 changed files with 4 additions and 2 deletions

View File

@ -207,7 +207,7 @@
let { trigger, show, hide, handleClick, splitButton, handleTriggerKeyDown, handleItemKeyDown } = this; let { trigger, show, hide, handleClick, splitButton, handleTriggerKeyDown, handleItemKeyDown } = this;
this.triggerElm = splitButton this.triggerElm = splitButton
? this.$refs.trigger.$el ? this.$refs.trigger.$el
: this.$slots.default[0].elm; : this.$refs.default;
let dropdownElm = this.dropdownElm; let dropdownElm = this.dropdownElm;
@ -284,7 +284,9 @@
return ( return (
<div class="el-dropdown" v-clickoutside={hide} aria-disabled={disabled}> <div class="el-dropdown" v-clickoutside={hide} aria-disabled={disabled}>
<div ref="default">
{triggerElm} {triggerElm}
</div>
{menuElm} {menuElm}
</div> </div>
); );