WebApp【公共组件库】@前端(For Git Submodule)
Tevin
2023-06-05 ca49ec2690b7b6c7b39a208064d10bce495767b3
优化数值调节阀组件操作体验
2 files modified
23 ■■■■ changed files
forms/numberValve/CNumberValve.vue 18 ●●●● patch | view | raw | blame | history
forms/numberValve/cNumberValve.scss 5 ●●●●● patch | view | raw | blame | history
forms/numberValve/CNumberValve.vue
@@ -49,7 +49,16 @@
                            @touchstart="evt => handleTouchStart()"
                            @touchmove="evt => handleTouchMove(evt)"
                        ></view>
                        <view class="current"><text class="text">{{current}}</text></view>
                        <view class="current">
                            <text
                                class="text m-text-ignore"
                                v-if="current===''"
                            >(请拖动)</text>
                            <text
                                class="text"
                                v-else
                            >{{current}}</text>
                        </view>
                    </view>
                </view>
                <view class="btn">
@@ -106,13 +115,16 @@
        return {
            opened: false,
            rect: { width: 0, left: 0 },
            current: 0,
            current: '',
            sliderLeft: 0,
        };
    },
    computed: {
        valueStr() {
            if (this.itemRes.formData[this.itemRes.name]) {
            if (
                this.itemRes.formData[this.itemRes.name] ||
                this.itemRes.formData[this.itemRes.name] === 0
            ) {
                return this.itemRes.formData[this.itemRes.name] + ' ' + this.unit;
            } else {
                return '';
forms/numberValve/cNumberValve.scss
@@ -122,6 +122,11 @@
                    .text {
                        @include position(absolute, -24PX 0 n n);
                        transform: translateX(-50%);
                        &.m-text-ignore {
                            font-size: 32px;
                            white-space: nowrap;
                            text-indent: 10px;
                        }
                    }
                }
            }