Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug Report] 【Enhancement】slider值范围较大时滑起来摩擦力很大 #2717

Closed
CACppuccino opened this issue Jan 27, 2020 · 5 comments · Fixed by #3876
Closed

[Bug Report] 【Enhancement】slider值范围较大时滑起来摩擦力很大 #2717

CACppuccino opened this issue Jan 27, 2020 · 5 comments · Fixed by #3876

Comments

@CACppuccino
Copy link

设备

All

VantWeapp 版本

1.0.4

基础库版本

2.8.3

请提供核心代码片段链接

https://github.com/youzan/vant-weapp/blob/dev/dist/slider/index.js

描述问题

在设置slider值为较大值时,如600,slider滑起来会非常难滑

@1sm23
Copy link
Contributor

1sm23 commented May 12, 2020

设置slider max时值较小时又太容易滑了

@zkl2333
Copy link

zkl2333 commented May 18, 2020

我是设置0-100然后自己映射数据

@hanks-hu
Copy link

也遇到了这个问题,如果和0~100映射的话,写起来也怪怪的

@Yvan7123
Copy link

Yvan7123 commented Sep 2, 2020

同遇到这个问题,我这边写的时时间条、不太好转化为0-100

@TheSunset
Copy link

TheSunset commented Oct 30, 2020

这个问题 可以到slider组件的js文件里找到这个方法

onTouchMove: function (event) {
            var _this = this;
            if (this.data.disabled)
                return;
            if (this.dragStatus === 'start') {
                this.$emit('drag-start');
            }
            this.touchMove(event);
            this.dragStatus = 'draging';
            this.getRect('.van-slider').then(function (rect) {
                var diff = (_this.deltaX / rect.width) * 100;
                _this.newValue = _this.startValue + diff;
                _this.updateValue(_this.newValue, false, true);
            });
        },

把上面的diff 后面乘的100 换成 _this.data.max 即可

rex-zsd pushed a commit to rex-zsd/vant-weapp that referenced this issue Dec 18, 2020
rex-zsd added a commit that referenced this issue Dec 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants