How to control the display and hiding of el-dropdown only with el-dropdown,?

I only quote el-dropdown, not el-dropdown-menu and el-dropdown-item.
the contents of dropdown are written by themselves, how to control the display and hiding of dropdown?

Mar.22,2021

solved. See that hiden () and show () methods are installed in the source code of dropdown. Add a ref to el-dropdown directly and run the method in the component through ref

.
<el-dropdown trigger="click" ref="messageDrop"></el-dropdown>

this.$refs.messageDrop.hide();
this.$refs.messageDrop.show();

this.$refs.xxx.dropdown.visible = false
just encountered this problem.


Thank you for the invitation. Refer to the internal writing of the el component and, if you remember correctly, use event passing and response within the component.

Menu