Merge pull request #592 from jhh678/patch-3
dropdown.vue: fix Pooper created multiple times
This commit is contained in:
commit
69416ce4cd
1 changed files with 10 additions and 12 deletions
|
@ -44,13 +44,11 @@
|
|||
methods: {
|
||||
update () {
|
||||
if (isServer) return;
|
||||
if (this.popper) {
|
||||
this.$nextTick(() => {
|
||||
if (this.popper) {
|
||||
this.popper.update();
|
||||
this.popperStatus = true;
|
||||
});
|
||||
} else {
|
||||
this.$nextTick(() => {
|
||||
this.popper = new Popper(this.$parent.$refs.reference, this.$el, {
|
||||
eventsEnabled: false,
|
||||
placement: this.placement,
|
||||
|
@ -70,13 +68,13 @@
|
|||
this.resetTransformOrigin();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
// set a height for parent is Modal and Select's width is 100%
|
||||
if (this.$parent.$options.name === 'iSelect') {
|
||||
this.width = parseInt(getStyle(this.$parent.$el, 'width'));
|
||||
}
|
||||
this.tIndex = this.handleGetIndex();
|
||||
});
|
||||
},
|
||||
destroy () {
|
||||
if (this.popper) {
|
||||
|
|
Loading…
Add table
Reference in a new issue