TypeError: Cannot read property ‘setData’ of undefined
this指代问题,因为此时的success是回调函数,回调函数this的指向回改变。
1、使用=>函数
success: (res)=>{
this.setData...
}
2. let that = this
data-**赋值为空
evt.currentTarget.id
id为小写,不支持大写
this指代问题,因为此时的success是回调函数,回调函数this的指向回改变。
1、使用=>函数
success: (res)=>{
this.setData...
}
2. let that = this
evt.currentTarget.id
id为小写,不支持大写