如何在page页面中调用生命周期函数中的变量和对象?
发布于 5 年前 作者 pingdeng 9698 次浏览 来自 问答
  dbgetname: function () {
    //如何在这里调用下面函数里的dbtest呢?this指针会显示未定义
  }
  onLoadfunction (options{
    const db = wx.cloud.database()
    const dbtest = db.collection('test')
  }

萌新疑惑

1 回复
 const db = wx.cloud.database()
 const dbtest = db.collection('test')

dbgetname: function () {
    //如何在这里调用下面函数里的dbtest呢?this指针会显示未定义
  }
  onLoad: function (options) {

  }

回到顶部