[英]Using <img> src in Ember cli
我無法通過Ember CLI顯示圖像。 我嘗試使用HTML <img>
標記,並在我的環境文件中做了一個例外:
contentSecurityPolicy: {
'img-src': "'self' * all"
}
我使用了這個<img>
標簽:
<img src="/public/images/image.png">
我收到以下錯誤消息:
Failed to load resource: the server responded with a status of 404 (Not Found)
我做錯了什么?
指定路徑時不要包括public
目錄。
相反,只需嘗試以下操作:
<img src="images/image.png">
<img src="assets/public/images/image.png">
請將您的圖片保存在上述路徑中,並在img標簽公用文件夾中提供此路徑,其中包含您的圖片路徑目錄。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.