parent
ceae82348b
commit
ff71751caa
1 changed files with 7 additions and 2 deletions
|
@ -23,7 +23,8 @@ Modal.newInstance = properties => {
|
|||
loading: false,
|
||||
buttonLoading: false,
|
||||
scrollable: false,
|
||||
closable: false
|
||||
closable: false,
|
||||
closing: false // 关闭有动画,期间使用此属性避免重复点击
|
||||
}),
|
||||
render (h) {
|
||||
let footerVNodes = [];
|
||||
|
@ -158,12 +159,14 @@ Modal.newInstance = properties => {
|
|||
},
|
||||
methods: {
|
||||
cancel () {
|
||||
if (this.closing) return;
|
||||
this.$children[0].visible = false;
|
||||
this.buttonLoading = false;
|
||||
this.onCancel();
|
||||
this.remove();
|
||||
},
|
||||
ok () {
|
||||
if (this.closing) return;
|
||||
if (this.loading) {
|
||||
this.buttonLoading = true;
|
||||
} else {
|
||||
|
@ -173,7 +176,9 @@ Modal.newInstance = properties => {
|
|||
this.onOk();
|
||||
},
|
||||
remove () {
|
||||
this.closing = true;
|
||||
setTimeout(() => {
|
||||
this.closing = false;
|
||||
this.destroy();
|
||||
}, 300);
|
||||
},
|
||||
|
|
Loading…
Add table
Reference in a new issue