We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
<!--pages/demo/demo.wxml--> <view style="padding-top:150px;"> <van-datetime-picker type="date" value="{{ currentDate }}" bind:input="onInput" min-date="{{ minDate }}" formatter="{{ formatter }}" /> </view> <view style="padding-top:50px;"> <van-button bindtap="clickChoose">往后选6个月</van-button> </view>
Page({ data: { currentDate: new Date().getTime(), minDate: new Date().getTime(), formatter(type, value) { if (type === 'year') { return `${value}年`; } if (type === 'month') { return `${value}月`; } return value; }, }, onInput(event) { this.setData({ currentDate: event.detail, }); }, clickChoose() { const cur = this.data.currentDate this.setData({ currentDate: cur + 1000 * 60 * 60 * 24 * 30 * 6 }) } });
1.11.7
直接点击按钮,通过this.setData设置时间选择器的值,会没有滚动动画; 当手势触摸滑动选择框后,再通过点击按钮js设置值,是会有预期的滚动动画。 查看@vant/weapp/lib/picker-column/index.js 发现DEFAULT_DURATION的值没有被设置在this.data.duration的初始值上。
重现链接中的代码demo,打开后直接点击按钮设置时间没有动画,手势触摸滑动时间选择器后再点按钮设置时间即可有动画
No response
The text was updated successfully, but these errors were encountered:
No branches or pull requests
重现链接
Vant Weapp 版本
1.11.7
描述一下你遇到的问题。
直接点击按钮,通过this.setData设置时间选择器的值,会没有滚动动画;
当手势触摸滑动选择框后,再通过点击按钮js设置值,是会有预期的滚动动画。
查看@vant/weapp/lib/picker-column/index.js 发现DEFAULT_DURATION的值没有被设置在this.data.duration的初始值上。
重现步骤
重现链接中的代码demo,打开后直接点击按钮设置时间没有动画,手势触摸滑动时间选择器后再点按钮设置时间即可有动画
设备/浏览器
No response
The text was updated successfully, but these errors were encountered: