| | |
| | | // 取值范围 |
| | | range: { |
| | | type: Array, |
| | | default: [0, 100], |
| | | default: () => [0, 100], |
| | | }, |
| | | // 步长 |
| | | step: { |
| | |
| | | handleChange(val) { |
| | | // 奇偶修正模式 |
| | | if (this.correct) { |
| | | const lastValue = this.itemRes.formData[this.itemRes.name]; |
| | | const lastValue = |
| | | this.itemRes.formData[this.itemRes.name] || this.range[0]; |
| | | let nextValue = val; |
| | | if ( |
| | | (this.correct === 'odd' && nextValue % 2 === 0) || |
| | | (this.correct === 'even' && nextValue % 2 === 1) |
| | | ) { |
| | | // 增加 |
| | | if (lastValue < nextValue) { |
| | | if (lastValue <= nextValue) { |
| | | nextValue++; |
| | | } |
| | | // 减小 |
| | |
| | | mounted() { |
| | | if (process.env.TARO_ENV === 'h5') { |
| | | $(this.$refs.input.$el) |
| | | .find('.at-input__input') |
| | | .find('.at-input__container') |
| | | .prepend(this.$refs.number.$el); |
| | | } else if (process.env.TARO_ENV === 'weapp') { |
| | | $(this.$refs.input.$el) |