Browse Source

Menu: fix open method error when collapse is changed (#11646)

Jikkai Xiao 7 years ago
parent
commit
7199da9836
1 changed files with 2 additions and 2 deletions
  1. 2 2
      packages/menu/src/submenu.vue

+ 2 - 2
packages/menu/src/submenu.vue

@@ -229,8 +229,6 @@
       }
     },
     created() {
-      this.parentMenu.addSubmenu(this);
-      this.rootMenu.addSubmenu(this);
       this.$on('toggle-collapse', this.handleCollapseToggle);
       this.$on('mouse-enter-child', () => {
         this.mouseInChild = true;
@@ -242,6 +240,8 @@
       });
     },
     mounted() {
+      this.parentMenu.addSubmenu(this);
+      this.rootMenu.addSubmenu(this);
       this.initPopper();
     },
     beforeDestroy() {