downloadurl不在控制台中显示,而是[object,Object] [截屏图片] 1
this.dbs.collection("databases").get().toPromise().then((snapshot) => {
snapshot.docs.forEach(doc=>{
let name=doc.data().path;
this.down=this.storage.ref(name).getDownloadURL();
console.log(name);
console.log(this.down);
})
答案 0 :(得分:0)
如果您查看the documentation,则getDownloadURL()
将返回一个承诺,因此您需要等待该承诺解决之后才能尝试访问它:
this.storage.ref(name).getDownloadURL().then((link) => {
this.down = link;
}