Dialog: fix incorrect updatePopper calls

pull/5289/head
Leopoldthecoder 2017-06-07 11:15:25 +08:00 committed by 杨奕
parent dfe8972e2c
commit f9b19d9aa1
2 changed files with 6 additions and 2 deletions

View File

@ -16,7 +16,9 @@
mixins: [Popper], mixins: [Popper],
created() { created() {
this.$on('updatePopper', this.updatePopper); this.$on('updatePopper', () => {
if (this.showPopper) this.updatePopper();
});
this.$on('visible', val => { this.$on('visible', val => {
this.showPopper = val; this.showPopper = val;
}); });

View File

@ -57,7 +57,9 @@
mounted() { mounted() {
this.referenceElm = this.$parent.$refs.reference.$el; this.referenceElm = this.$parent.$refs.reference.$el;
this.$parent.popperElm = this.popperElm = this.$el; this.$parent.popperElm = this.popperElm = this.$el;
this.$on('updatePopper', this.updatePopper); this.$on('updatePopper', () => {
if (this.$parent.visible) this.updatePopper();
});
this.$on('destroyPopper', this.destroyPopper); this.$on('destroyPopper', this.destroyPopper);
} }
}; };