MPComponent / mpvue-picker

基于 mpvue 框架的小程序选择控件,支持单列,多列,联动。
MIT License
172 stars 77 forks source link

使用picker mode为selector,pickerValueDefault改变,视图默认选中的不对,很随机,也没有发现规律 #44

Open yinxh2016 opened 4 years ago

yinxh2016 commented 4 years ago

pickerValueDefault改变,视图默认选中的不对

KuangPF commented 4 years ago

pickerValueDefault 只会在第一次初始化 picker 的时候生效。

aoeng commented 4 years ago

pickerValueDefault 默认的是index索引,而不是value的值,我真的要吐了

KuangPF commented 4 years ago

@aoeng 用 index 索引是为了保证数据的唯一,如果用 value 数据重复的话就会存在问题,像小程序原生 picker 组件同样是用的 index 作为值。