Merge pull request #592 from jhh678/patch-3

dropdown.vue: fix Pooper created multiple times
This commit is contained in:
Aresn 2021-01-20 14:57:07 +08:00 committed by GitHub
commit 69416ce4cd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -44,13 +44,11 @@
methods: {
update () {
if (isServer) return;
if (this.popper) {
this.$nextTick(() => {
this.$nextTick(() => {
if (this.popper) {
this.popper.update();
this.popperStatus = true;
});
} else {
this.$nextTick(() => {
} else {
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();
}
// 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) {