mirror of https://github.com/ElemeFE/element
Dialog: fix vuex compatibility
parent
7f70ea6726
commit
84657095c4
|
@ -19,7 +19,7 @@
|
||||||
name: '王小虎',
|
name: '王小虎',
|
||||||
address: '上海市普陀区金沙江路 1518 弄'
|
address: '上海市普陀区金沙江路 1518 弄'
|
||||||
}],
|
}],
|
||||||
dialogVisible: true,
|
dialogVisible: false,
|
||||||
dialogTableVisible: false,
|
dialogTableVisible: false,
|
||||||
dialogFormVisible: false,
|
dialogFormVisible: false,
|
||||||
outerVisible: false,
|
outerVisible: false,
|
||||||
|
|
|
@ -94,10 +94,17 @@
|
||||||
beforeClose: Function
|
beforeClose: Function
|
||||||
},
|
},
|
||||||
|
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
closed: false
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
watch: {
|
watch: {
|
||||||
visible(val) {
|
visible(val) {
|
||||||
this.$emit('update:visible', val);
|
this.$emit('update:visible', val);
|
||||||
if (val) {
|
if (val) {
|
||||||
|
this.closed = false;
|
||||||
this.$emit('open');
|
this.$emit('open');
|
||||||
this.$el.addEventListener('scroll', this.updatePopper);
|
this.$el.addEventListener('scroll', this.updatePopper);
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
|
@ -108,7 +115,7 @@
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.$el.removeEventListener('scroll', this.updatePopper);
|
this.$el.removeEventListener('scroll', this.updatePopper);
|
||||||
this.$emit('close');
|
if (!this.closed) this.$emit('close');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -141,6 +148,8 @@
|
||||||
hide(cancel) {
|
hide(cancel) {
|
||||||
if (cancel !== false) {
|
if (cancel !== false) {
|
||||||
this.$emit('update:visible', false);
|
this.$emit('update:visible', false);
|
||||||
|
this.$emit('close');
|
||||||
|
this.closed = true;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
updatePopper() {
|
updatePopper() {
|
||||||
|
|
Loading…
Reference in New Issue