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 | 21 | data () { |
22 | 22 | return { |
23 | 23 | popper: null, |
24 | - width: '' | |
24 | + width: '', | |
25 | + popperStatus: false | |
25 | 26 | }; |
26 | 27 | }, |
27 | 28 | computed: { |
... | ... | @@ -37,6 +38,7 @@ |
37 | 38 | if (this.popper) { |
38 | 39 | this.$nextTick(() => { |
39 | 40 | this.popper.update(); |
41 | + this.popperStatus = true; | |
40 | 42 | }); |
41 | 43 | } else { |
42 | 44 | this.$nextTick(() => { |
... | ... | @@ -65,10 +67,11 @@ |
65 | 67 | destroy () { |
66 | 68 | if (this.popper) { |
67 | 69 | setTimeout(() => { |
68 | - if (this.popper) { | |
70 | + if (this.popper && !this.popperStatus) { | |
69 | 71 | this.popper.destroy(); |
70 | 72 | this.popper = null; |
71 | 73 | } |
74 | + this.popperStatus = false; | |
72 | 75 | }, 300); |
73 | 76 | } |
74 | 77 | }, | ... | ... |