且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

从Firebase数据库读取和显示数据

更新时间:2022-06-03 03:20:21

错误消息告诉您 this 为空.为了确保保留它,将 gotData 定义为箭头函数:

The error message tells you that this is null. To ensure that it is preserved, define gotData as an arrow function:

gotData = (data) => {
   this.courses = data.val();
}