微信小程序component子组件中this是个undefined

微信小程序component子组件中this是个undefined

//调用aaaa()
 aaaa() {
      let that = this
      //console.log(this),结果是个undefined
      wx.getConnectedWifi({
        success(res) {
          const wifi = res.wifi
          that.setData({
            SSID: wifi.SSID
          })
        },
        fail(err) {console.log(err~~~~)}
      })
    },
待解决 悬赏分:10 - 离问题结束还有 33天2小时16分55秒
反对 0举报 0 收藏 0

我来回答

回答0