[bugfix] DropdownMenu: cann't use toggle to open item (#3876)

This commit is contained in:
neverland
2019-07-17 14:40:12 +08:00
committed by GitHub
parent e6a13e8887
commit 3f33fcc525
4 changed files with 87 additions and 72 deletions
+8 -11
View File
@@ -40,19 +40,17 @@ export default createComponent({
},
methods: {
toggle(show) {
this.showPopup = !this.showPopup;
if (this.showPopup) {
this.showWrapper = true;
toggle(show = !this.showPopup, options = {}) {
if (show === this.showPopup) {
return;
}
},
hide(skipTransition) {
this.showPopup = false;
this.transition = !options.immediate;
this.showPopup = show;
if (skipTransition) {
this.transition = false;
if (show) {
this.parent.updateOffset();
this.showWrapper = true;
}
}
},
@@ -120,7 +118,6 @@ export default createComponent({
onClose={this.onClose}
onOpened={this.onOpened}
onClosed={() => {
this.transition = true;
this.showWrapper = false;
this.$emit('closed');
}}