Kaynağa Gözat

Dropdown: fix placement

qingwei.li 8 yıl önce
ebeveyn
işleme
03a01b8dfd
1 değiştirilmiş dosya ile 5 ekleme ve 2 silme
  1. 5 2
      packages/dropdown/src/dropdown-menu.vue

+ 5 - 2
packages/dropdown/src/dropdown-menu.vue

@@ -27,8 +27,11 @@
     },
 
     watch: {
-      '$parent.menuAlign'(val) {
-        this.currentPlacement = `bottom-${val}`;
+      '$parent.menuAlign': {
+        immediate: true,
+        handler(val) {
+          this.currentPlacement = `bottom-${val}`;
+        }
       }
     }
   };