Replies: 9 comments 2 replies
-
@wjw-gavin 好的,谢谢, 如果有二级的话 , checked值也是要需要绑定值来自数据源本身吗 |
Beta Was this translation helpful? Give feedback.
-
其实当你要绑定默认值时,应该是从数据源中去匹配对应的勾选项,而不是重新定义一个“看上去”跟他一样的数据。看上去一样,就好比 |
Beta Was this translation helpful? Give feedback.
-
@wjw-gavin 不, 我的意思 是, |
Beta Was this translation helpful? Give feedback.
-
如果你的子项也使用 |
Beta Was this translation helpful? Give feedback.
-
@wjw-gavin 我已经试过了, 谢谢。 都用的是CheckboxGroup , 如果子项我只选了一个, 你的checked 数据结构是什么 , checked 和list(原始数据)是绑定的, 明显有bug , 个人觉得, checked 不能用全等 , 只要属性相同就可以了, 而且日常开发中,checked 对象数组的 场景比较多 , 大佬,有购物车的三级选中 , 用vant checkbox 的实现的案例吗, 我看看大佬是怎么写的, 或者好的文章 , 谢谢 |
Beta Was this translation helpful? Give feedback.
-
@wjw-gavin 大佬你能写一个购物车的三级选中吗, 用vant checkbox , 让我学习学习 |
Beta Was this translation helpful? Give feedback.
-
@wjw-gavin 大佬 购物车三级选中功能建议怎么去实现, 绑定对象,还是id 属性 |
Beta Was this translation helpful? Give feedback.
-
I will convert issue to a discussion because is is not a bug or feature. |
Beta Was this translation helpful? Give feedback.
-
重现链接
https://codesandbox.io/s/vant-3-issue-template-forked-o54p4e?file=/src/App.vue
Vant 版本
3.24
描述一下你遇到的问题。
默认值无法选中
重现步骤
默认值无法选中
设备/浏览器
No response
Beta Was this translation helpful? Give feedback.
All reactions