¶Ô±ÈÐÂÎļþ |
| | |
| | | export default { |
| | | data() { |
| | | return { |
| | | sliderRect: {}, |
| | | info: { |
| | | width: null, |
| | | left: null, |
| | | step: this.step, |
| | | disabled: this.disabled, |
| | | min: this.min, |
| | | max: this.max, |
| | | value: this.value |
| | | } |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.init() |
| | | }, |
| | | methods: { |
| | | init() { |
| | | this.getSliderRect() |
| | | }, |
| | | // è·åslider尺寸 |
| | | getSliderRect() { |
| | | // è·åæ»åæ¡çå°ºå¯¸ä¿¡æ¯ |
| | | uni.$u.sleep().then(() => { |
| | | this.$uGetRect('.u-slider').then((rect) => { |
| | | this.info.width = rect.width |
| | | this.info.left = rect.left |
| | | }) |
| | | }) |
| | | }, |
| | | // æ¤æ¹æ³ç±wxsè°ç¨ï¼ç¨äºä¿®æ¹v-modelç»å®çå¼ |
| | | updateValue(value) { |
| | | this.$emit('input', value) |
| | | }, |
| | | // æ¤æ¹æ³ç±wxsè°ç¨ï¼ååºäºä»¶ |
| | | emitEvent(e) { |
| | | this.$emit(e.event, e.value ? e.value : this.value) |
| | | } |
| | | } |
| | | } |