1. 程式人生 > >小程式for迴圈中input事件的處理

小程式for迴圈中input事件的處理

bindManual:function(e){ var that=this; var id = e.currentTarget.id; console.log(id) that.setData({ num: e.detail.value }) console.log(that.data.num) }, bindMinus:function(e){ var that = this var index = e.currentTarget.id var newnum = that.data.num --newnum var newarr = that.data.newarry newarr[index] = newnum that.setData({ newarry: newarr }) }, bindPlus:function
(e){ var that = this var index = e.currentTarget.id var newarr = that.data.newarry var newnum = that.data.num newnum++ newarr[index] = newnum that.setData({ newarry: newarr }) }, wxml