// 箭头函数 this 指向上一层对象
wx.chooseLocation({
success: (res) => {
this.lng = res.longitude
this.lat = res.latitude
this.address = res.address
}
})
// 简写方式,this 指向当前对象,报错
wx.chooseLocation({
success (res) {
this.lng = res.longitude
this.lat = res.latitude
this.address = res.address
}
})