Browse Source

Cascader: fix z-index not increasing issue (#3035)

杨奕 8 năm trước cách đây
mục cha
commit
82a3685138
2 tập tin đã thay đổi với 5 bổ sung1 xóa
  1. 1 0
      packages/cascader/src/main.vue
  2. 4 1
      packages/cascader/src/menu.vue

+ 1 - 0
packages/cascader/src/main.vue

@@ -211,6 +211,7 @@ export default {
       this.popperElm = this.menu.$el;
       this.menu.$on('pick', this.handlePick);
       this.menu.$on('activeItemChange', this.handleActiveItemChange);
+      this.menu.$on('menuLeave', this.doDestroy);
     },
     showMenu() {
       if (!this.menu) {

+ 4 - 1
packages/cascader/src/menu.vue

@@ -78,6 +78,9 @@
         }
         this.$emit('pick', this.activeValue);
       },
+      handleMenuLeave() {
+        this.$emit('menuLeave');
+      },
       activeItem(item, menuIndex) {
         const len = this.activeOptions.length;
         this.activeValue.splice(menuIndex, len, item.value);
@@ -151,7 +154,7 @@
         );
       });
       return (
-        <transition name="el-zoom-in-top">
+        <transition name="el-zoom-in-top" on-after-leave={this.handleMenuLeave}>
           <div
             v-show={visible}
             class={[