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] DatePicker|TimePicker组件的v-model赋值比onConfirm取值慢 #11186

Closed
MsRem opened this issue Oct 28, 2022 · 3 comments · Fixed by #11194
Closed

[Bug Report] DatePicker|TimePicker组件的v-model赋值比onConfirm取值慢 #11186

MsRem opened this issue Oct 28, 2022 · 3 comments · Fixed by #11194
Labels
Milestone

Comments

@MsRem
Copy link

MsRem commented Oct 28, 2022

重现链接

https://codesandbox.io/s/vant4-0-0-rc6-time-picker-qozqp9?file=/src/App.vue:67-71&resolutionWidth=320&resolutionHeight=675

Vant 版本

v4.0.0-rc.6

描述一下你遇到的问题。

onConfirm中返回selectedValues和v-model绑定的值不一致,必须要等待滚动动画结束v-model才能获取到相同的值。
image

重现步骤

  1. 打开https://qozqp9.csb.app/
  2. 控制台设置为手机查看
  3. 在滚动动画未结束前点击确定
  4. 查看打印数据

设备/浏览器

@wjw-gavin
Copy link
Collaborator

这....我觉得就好像是在create生命周期获取dom一样吧...

@MsRem
Copy link
Author

MsRem commented Oct 28, 2022

这....我觉得就好像是在create生命周期获取dom一样吧...

当我在配合popup一块使用的时候会发现popup被关闭了,但是并没有附上正确的值(本次想选择的值)。
不然每次我都在onConfirm中去手动赋值的话,v-model好像就失去了原本的意义。

@chenjiahan
Copy link
Member

这里确实应该保持一致,我修一下

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants