that.setDate is not a function错误如何解决呢?求大神指导

发布于 6 年前作者 ming3714026 次浏览最后编辑 6 年前来自 issues
getWeather: function(){
    var that = this;
    wx.request({
      url: 'https://free-api.heweather.com/s6/weather/now',
      data:{
        location:that.data.region[1],
        key:'07e21eda4e604f8dbce0d1'
      },
      success: function(res){
        that.setDate({
          now:res.data.HeWeather6[0].now
        });
      }

})

6 回复
li50
li501 楼6 年前

0110 0110 0110

lipeng
lipeng2 楼6 年前

that.setData({

                    deposit: res.data.date.deposit,

                    rent_num: res.data.date.rent_num,//租电次数

                    today_hd_num: res.data.date.today_hd_num,//换电次数

                    type: res.data.date.type,

                    dsb:res.data.date.dsb

                })

jing08
jing083 楼6 年前

setDate写着不感觉奇怪吗。。。。。

chao49
chao494 楼6 年前

setData哈,不是Date,data是数据的意思,date是日期的意思。

nagong
nagong5 楼6 年前

时间刺客?

zye
zye6 楼4 年前

setData