在 Ember cli 中使用 <img> src

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 标签中给出此路径 public 文件夹包含您的图片路径目录。