Преглед изворни кода

Update component.vue

For using `done(false)` as well as `vue-router.beforeEach` function `next(false)`.
There are cases when it is necessary.
patriciussanctus пре 8 година
родитељ
комит
3bdeb592df
1 измењених фајлова са 5 додато и 3 уклоњено
  1. 5 3
      packages/dialog/src/component.vue

+ 5 - 3
packages/dialog/src/component.vue

@@ -122,9 +122,11 @@
           this.hide();
         }
       },
-      hide() {
-        this.$emit('update:visible', false);
-        this.$emit('visible-change', false);
+      hide(cancel) {
+        if (cancel !== false) {
+          this.$emit('update:visible', false);
+          this.$emit('visible-change', false);
+        }
       },
       updatePopper() {
         this.broadcast('ElSelectDropdown', 'updatePopper');