收藏
回答

云数据库调用过程中设置数据导致后续程序不调用

框架类型 问题类型 终端类型 AppID 环境ID 基础库版本
小程序 Bug 工具 wx2cd07c2a2fd11237 benehome 2.8.1
exist: function (e{
        db = wx.cloud.database()
        db.collection("test").get(
            {
                successfunction(res){
                    console.log(0)
                    this.setData({
                        text:1
                    }, function(){
                        console.log("that.data.text")
                    })
                    console.log(1)
                }
            }
        )
    }
最后输出只输出0,其他的啥也不输出
回答关注问题邀请回答
收藏

1 个回答

  • Mr.Zhao
    Mr.Zhao
    2020-04-18
    exist: function (e{
     db = wx.cloud.database()
     db.collection("test").get(
       {
        success(res) => {
         this.setData({
          text1
         })
       }
      })
    }
    
    2020-04-18
    有用 1
    回复 3
    • Bay👻
      Bay👻
      2020-04-18
      好了!什么原因呢。。我是小白,谢谢大佬
      2020-04-18
      回复
    • Mr.Zhao
      Mr.Zhao
      2020-04-18回复Bay👻
      this作用域的问题  你百度搜搜 js this 很多文章的
      2020-04-18
      回复
    • Bay👻
      Bay👻
      2020-04-18
      好的!谢谢大佬!
      2020-04-18
      回复
登录 后发表内容
问题标签