Dialog: fix incorrect updatePopper calls

This commit is contained in:
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],
created() {
this.$on('updatePopper', this.updatePopper);
this.$on('updatePopper', () => {
if (this.showPopper) this.updatePopper();
});
this.$on('visible', val => {
this.showPopper = val;
});

View File

@ -57,7 +57,9 @@
mounted() {
this.referenceElm = this.$parent.$refs.reference.$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);
}
};