我打赌这是一件非常微不足道的事情,但即使是文档也没有明确说明。我不得不提到,在谷歌搜索中写有关firebase的任何内容,返回的主题大多与android有关,而不是JS/WEB...
问题在于我有一个存储文件夹images
,其中保存了...图片。我希望在进入我的网站时检索它。我的尝试:
componentDidMount() {
const images = firebase.storage().ref().child('companyImages');
const image = images.child('image1'); <---------------- // file name is image1
image.on('value', (snap) => this.setState({ img: snap.val() }));
}
但是它并没有像我预想的那样工作。正如您所看到的,我希望将此图像存储在状态中,然后在站点的某些部分显示。
期待任何提示等。 谢谢你 :)
const images = firebase.storage().ref().child('companyImages');
没有从 Firebase 中检索数据吗? - Kenry SanchezauthWrapper
和location
。 - Patrickkx