【发布时间】:2020-02-09 06:19:17
【问题描述】:
根据this
在你有一个 URL 之后:
http://storage.googleapis.com/example-bda7b.appspot.com/images/someone-Lopez.jpg
您仍然需要运行 getDownloadURL,如下所示:
storageRef.child(urll).getDownloadURL()
这对我来说似乎适得其反,如果您已经有了图像存储 url,为什么需要运行 getdownload url 并等待响应?
我已将我的存储设置为公开。我怎么能执行类似(反应):
<img
alt={props.data.last}
className="rounded-circle"
src={http://storage.googleapis.com/example-bda7b.appspot.com/images/someone-Lopez.jpg}
/>
上面的例子有可能吗?或者 var storage = firebase.storage(); var pathReference = storage.ref('images/stars.jpg');
<img
alt={props.data.last}
className="rounded-circle"
src={pathReference}
/>
Firebase 在文档中给出了这个例子,但实际上并没有给出如何合并它的任何想法。
// Create a reference with an initial file path and name
var storage = firebase.storage();
var pathReference = storage.ref('images/stars.jpg');
【问题讨论】:
标签: firebase