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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-28 15:32:14  来源:igfitidea点击:

ember-cli where to put images

javascriptember.jsember-cli

提问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/assetsvs app/stylesTo add images, fonts, or other assets, place them in the public/assets directory. For example, if you place logo.pngin public/assets/images, you can reference it in templates with assets/images/logo.pngor in stylesheets with url('/assets/images/logo.png').

public/assetsvsapp/styles要添加图像、字体或其他资产,请将它们放在 public/assets 目录中。例如,如果放置logo.png在 中public/assets/images,则可以在带有 的模板中assets/images/logo.png或在带有 的样式表中引用它url('/assets/images/logo.png')