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: {
|
methods: {
|
||||||
update () {
|
update () {
|
||||||
if (isServer) return;
|
if (isServer) return;
|
||||||
if (this.popper) {
|
this.$nextTick(() => {
|
||||||
this.$nextTick(() => {
|
if (this.popper) {
|
||||||
this.popper.update();
|
this.popper.update();
|
||||||
this.popperStatus = true;
|
this.popperStatus = true;
|
||||||
});
|
} else {
|
||||||
} else {
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.popper = new Popper(this.$parent.$refs.reference, this.$el, {
|
this.popper = new Popper(this.$parent.$refs.reference, this.$el, {
|
||||||
eventsEnabled: false,
|
eventsEnabled: false,
|
||||||
placement: this.placement,
|
placement: this.placement,
|
||||||
|
@ -70,13 +68,13 @@
|
||||||
this.resetTransformOrigin();
|
this.resetTransformOrigin();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
}
|
||||||
}
|
// set a height for parent is Modal and Select's width is 100%
|
||||||
// set a height for parent is Modal and Select's width is 100%
|
if (this.$parent.$options.name === 'iSelect') {
|
||||||
if (this.$parent.$options.name === 'iSelect') {
|
this.width = parseInt(getStyle(this.$parent.$el, 'width'));
|
||||||
this.width = parseInt(getStyle(this.$parent.$el, 'width'));
|
}
|
||||||
}
|
this.tIndex = this.handleGetIndex();
|
||||||
this.tIndex = this.handleGetIndex();
|
});
|
||||||
},
|
},
|
||||||
destroy () {
|
destroy () {
|
||||||
if (this.popper) {
|
if (this.popper) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue