javascript ember-cli 放置图片的位置
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/32629787/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
ember-cli where to put images
提问by Undefined
In the ember-cli folder structure where should I put images?
在 ember-cli 文件夹结构中,我应该在哪里放置图像?
/app
/bower_components
/config
/dist
/node_modules
/public
/tests
/vendor
I am using ember-cli version 1.13.1.
我正在使用 ember-cli 版本 1.13.1。
回答by Undefined
Create a folder inside public -> public/assets/images/
, and place your images inside. You can then access them in the browser using /assets/images/imagename.png
在 public -> 中创建一个文件夹public/assets/images/
,并将您的图像放入其中。然后,您可以在浏览器中使用/assets/images/imagename.png
Source from the ember-cli documentationit states:
来自ember-cli 文档的来源,它指出:
Raw Assets
原始资产
public/assets
vs app/styles
To add images, fonts, or other assets, place them in the public/assets directory. For example, if you place logo.png
in public/assets/images
, you can reference it in templates with assets/images/logo.png
or in stylesheets with url('/assets/images/logo.png')
.
public/assets
vsapp/styles
要添加图像、字体或其他资产,请将它们放在 public/assets 目录中。例如,如果放置logo.png
在 中public/assets/images
,则可以在带有 的模板中assets/images/logo.png
或在带有 的样式表中引用它url('/assets/images/logo.png')
。