WebApp【公共组件库】@前端(For Git Submodule)
Tevin
2022-01-07 19fdb56f6e2d088b63d5e807974cff77de34799d
优化数值输入组件
1 files modified
5 ■■■■■ changed files
forms/numberStep/CNumberStep.vue 5 ●●●●● patch | view | raw | blame | history
forms/numberStep/CNumberStep.vue
@@ -77,14 +77,15 @@
        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++;
                    }
                    // 减小