Commit e6edc172ff7a66c435bc76d3420bcf5c87f680da
1 parent
320fba54
fix select dropdown position
Showing
1 changed file
with
5 additions
and
2 deletions
Show diff stats
src/components/select/dropdown.vue
| @@ -21,7 +21,8 @@ | @@ -21,7 +21,8 @@ | ||
| 21 | data () { | 21 | data () { |
| 22 | return { | 22 | return { |
| 23 | popper: null, | 23 | popper: null, |
| 24 | - width: '' | 24 | + width: '', |
| 25 | + popperStatus: false | ||
| 25 | }; | 26 | }; |
| 26 | }, | 27 | }, |
| 27 | computed: { | 28 | computed: { |
| @@ -37,6 +38,7 @@ | @@ -37,6 +38,7 @@ | ||
| 37 | if (this.popper) { | 38 | if (this.popper) { |
| 38 | this.$nextTick(() => { | 39 | this.$nextTick(() => { |
| 39 | this.popper.update(); | 40 | this.popper.update(); |
| 41 | + this.popperStatus = true; | ||
| 40 | }); | 42 | }); |
| 41 | } else { | 43 | } else { |
| 42 | this.$nextTick(() => { | 44 | this.$nextTick(() => { |
| @@ -65,10 +67,11 @@ | @@ -65,10 +67,11 @@ | ||
| 65 | destroy () { | 67 | destroy () { |
| 66 | if (this.popper) { | 68 | if (this.popper) { |
| 67 | setTimeout(() => { | 69 | setTimeout(() => { |
| 68 | - if (this.popper) { | 70 | + if (this.popper && !this.popperStatus) { |
| 69 | this.popper.destroy(); | 71 | this.popper.destroy(); |
| 70 | this.popper = null; | 72 | this.popper = null; |
| 71 | } | 73 | } |
| 74 | + this.popperStatus = false; | ||
| 72 | }, 300); | 75 | }, 300); |
| 73 | } | 76 | } |
| 74 | }, | 77 | }, |