微信小程序一堆input输入框的赋值问题

// html

<input placeholder-style="color:#aaaaaa;" class="weui-input right-input" placeholder="可以添加备注信息" data-key="remark1" bindinput="singleInput" />					


// js

singleInput: function(e) {
    console.log('e===', e)
    let key = e.currentTarget.dataset.key
    let value = e.detail.value
    let temp = this.data.singleData
    temp[key] = value
    this.setData(
      {
        singleData:temp
      }
    )
  }

猜你喜欢

转载自blog.csdn.net/strong90/article/details/107506673