return返回函数结果为undefind?
发布于 6 年前 作者 qma 12627 次浏览 来自 问答
this.data.Math=this._loadData("Math")
console.log(this.data.Math)
  _loadData:function(className,b){
    db.collection('LessonList_Test').where({
     videoClass: className
    }).orderBy('Date''desc').limit(10).get().then(res => {
      console.log(res.data);
    return res.data;
    })
  }

两个结果,只有函数中打印的出来。

这个可能是异步执行的结果。

怎么解决这个问题,让第一个打印也有结果。

1 回复

那是异步函数啊

回到顶部