我正在尝试向我的 meteor 应用程序提供图像,因此我将图像放入公共(public)文件夹中,但该图像没有出现在应用程序中(它仅显示损坏的图像)。但是当我将图像放入根文件夹时,它工作得很好。
在与此类问题相关的其他问题中,我应该查看 app_root/.meteor/build/static/内部,但在我的应用程序中,构建文件夹内没有任何静态文件夹
可能是什么问题?
最佳答案
建议您使用./public
用于提供静态 Assets 的目录。
给定以下目录结构:
- server
- client
- public
- css
- bootstrap.css
- images
- js
您可以通过从链接文档中删除“public”来提供静态资源。
<link href='/css/bootstrap.css'>
Files in /public are served to the client as-is. Use this to store assets such as images. For example, if you have an image located at /public/background.png, you can include it in your HTML with or in your CSS with background-image: url(/background.png). Note that /public is not part of the image URL.
关于javascript - 公共(public)文件夹在 Meteor 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20923506/