如提所说,在同一个页面存了多个picker,其中一个picker选择了值,另外的picker也会自动改变,请大神帮忙看一下。
我看之前社区的写法,
const curindex = e.target.dataset.current;
this.sex[curindex].index=e.target.value;
可是我调试时 e.target.dataset.current显示undefined。
附件为代码截图。
如提所说,在同一个页面存了多个picker,其中一个picker选择了值,另外的picker也会自动改变,请大神帮忙看一下。
我看之前社区的写法,
const curindex = e.target.dataset.current;
this.sex[curindex].index=e.target.value;
可是我调试时 e.target.dataset.current显示undefined。
附件为代码截图。
1***@qq.com (作者)
已经解决,每个picker的index都一样,所以改变其中一个,另一个也会变。定义多个index,如index1,index2...,每个picker用的index都不一样,就可以解决这个问题。
小菜鸟折腾了好几天,呜呜。。。。。。