onTapSelectField(e) { const index = e.currentTarget.dataset.index const picker = this.selectComponent(`.picker-${index}`) if (this.data.value[index]) { picker.setColumnValue(0, this.data.fieldContent[index][this.data.value[index]]) } this.setData({ showActionSheet: { [index]: true }, }) },
onTapSelectField(e) { const index = e.currentTarget.dataset.index const picker = this.selectComponent(`.picker-${index}`) if (this.data.value[index]) { picker.setColumnValue(0, this.data.fieldContent[index][this.data.value[index]]) } this.setData({ showActionSheet: { [index]: true }, }) },
onTapSelectField(e) {
const index = e.currentTarget.dataset.index
const picker = this.selectComponent(`.picker-${index}`)
if (this.data.value[index]) {
picker.setColumnValue(0, this.data.fieldContent[index][this.data.value[index]])
}
this.setData({
showActionSheet: {
[index]: true
},
})
},

用户252301526
2025年02月06日
|
浏览 167
这段代码看起来是一个事件处理函数,当某个字段被点击时触发。它首先获取点击的字段索引,然后根据索引选择对应的 picker 组件,并设置其列的值。接着通过 setData 方法更新 showActionSheet 状态,显示对应的 ActionSheet。
我要提问
复制内容
分享给好友
AI编程问答网 免责声明:
以上内容除特别注明外均来源于网友提问,AI编程问答网回答,权益归原著者所有;
