| | |
| | | let $slider = null; |
| | | if (process.env.TARO_ENV === 'h5') { |
| | | $slider = $(this.$refs.slider.$el); |
| | | const rect = $slider[0].getBoundingClientRect(); |
| | | this.rect.width = rect.width; |
| | | this.rect.left = rect.left; |
| | | } else if (process.env.TARO_ENV === 'weapp') { |
| | | $slider = $(this.$refs.slider); |
| | | Taro.createSelectorQuery() |
| | | .select('#' + this.$refs.slider.uid) |
| | | .boundingClientRect(rect => { |
| | | this.rect.width = rect.width; |
| | | this.rect.left = rect.left; |
| | | }) |
| | | .exec(); |
| | | } |
| | | Taro.createSelectorQuery() |
| | | .select('#' + this.$refs.slider.uid) |
| | | .boundingClientRect(rect => { |
| | | this.rect.width = rect.width; |
| | | this.rect.left = rect.left; |
| | | }) |
| | | .exec(); |
| | | }, |
| | | handleChangeVal(type, value) { |
| | | this.updateRect(); |