Browse Source

fix: dialog组件式调用

guoxiaoxiao8 5 years ago
parent
commit
6cbc8ba2c7
1 changed files with 4 additions and 4 deletions
  1. 4 4
      src/packages/dialog/dialog.vue

+ 4 - 4
src/packages/dialog/dialog.vue

@@ -202,7 +202,7 @@ export default {
       this.close('modal');
       this.close('modal');
     },
     },
     todestroy(){
     todestroy(){
-      this.canDestroy? this.destroy=false:"";
+      this.canDestroy? "":this.destroy=false;
     },
     },
     close(target) {
     close(target) {
       this.$emit('close', target);
       this.$emit('close', target);
@@ -222,11 +222,11 @@ export default {
         this.onOkBtn.call(this);
         this.onOkBtn.call(this);
       }
       }
     },
     },
-    cancelBtnClick(autoClose) {      
+    cancelBtnClick(autoClose) {   
+       this.$emit('cancel-btn-click');   
       if(!autoClose){
       if(!autoClose){
         return
         return
-      }
-      this.$emit('cancel-btn-click');
+      } 
       if (typeof this.onCancelBtn === 'function') {
       if (typeof this.onCancelBtn === 'function') {
         if (this.onCancelBtn.call(this) === false) {return};
         if (this.onCancelBtn.call(this) === false) {return};
       }
       }