Open microkof opened 2 years ago
可以在 el-select 组件上添加 focus 事件,当触发 el-select 组件的 focus 事件后获取 el-popover 组件 调用其内部的 doClose 事件手动关闭。
<el-select
@focus="selectFocus"
>
.../
<el-popover
ref="popover"
>
.../
// methods
methods: {
selectFocus() {
this.$refs.popover.doClose();
},
},`
这个方法在跨组件的时候 好像并不能用
Element UI version
2.15.7
OS/Browsers version
Windows 10 64 / Chrome 86
Vue version
2.6.14
Reproduction Link
https://codepen.io/microkof/pen/dyZyaqd
Steps to reproduce
Copy the Select component and Popover component from the official website's examples.
Click to open the Popover component.
Click to open the Select component and you will find that Popover is not stowed.
What is Expected?
Click to open the Select component and Popover will stow.
What is actually happening?
Click to open the Select component and you will find that Popover is not stowed.