用户界面不同-部署中未显示图标 [英] UI different -- Icons are not showing -- in deployment

查看:56
本文介绍了用户界面不同-部署中未显示图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的Rails应用程序中,部署中未显示图标.不仅仅是不显示图标.当我从开发中的应用程序中排除图标时,仅缺少图标.在部署中,应该在其中出现图标的位置是单击相关图标后将出现的弹出框.在菜单中,当我排除图标时,应在最右边的项目在其他项目的下面,在最左边,从而弄乱了整个UI.发生了什么事,我不知道那是什么.

In my rails app, icons are not showing in deployment. And it's not just that icons are not showing. When I exclude icons from my app in development, only icons are missing. In deployment, where icons should be are the popup boxes that would have appeared by clicking on the icons in question. In menu, when I exclude icon, the item that should be far right is far left, below other items, messing up the whole UI. Something is going on, and I don't know what that is.

我正在使用UIKit.我已经在资产/样式表和资产/javascript中下载并添加了它的CSS,JS和图标文件.

I'm using UIKit. I've downloaded and added its CSS, JS, and icons files in asset/stylesheet and asset/javascript.

由于仅在这种情况下图标才在开发中不起作用,因此我将其包括在头部:

Because icons were not working in development only with this arrangement, I included in the head:

 <script src="https://cdnjs.cloudflare.com/ajax/libs/uikit/3.1.7/js/uikit-icons.min.js"></script>

然后图标在开发中显示.

Then the icons were showing in development.

我不太确定可能会有什么不同.我已经奔跑

I'm not really sure what could be different. I've run

$bundle exec rake assets:precompile RAILS_ENV=production

它并没有帮助.

我还尝试下载图标文件夹并将其放在我的资产/图像中,然后从标题中调用它.没用

I also tried downloading the icons folder and placing it in my asset/images and calling it from the header. It didn't work.

推荐答案

所以解决方案是为JavaScript添加CDN链接(UIKit).现在显示图标,并且在生产中运行良好.

So the solution was the add CDN link (UIKit) for javascript. Now icons are showing and it's working fine in production.

为什么仅将JS,CSS和icon.js文件拖放到资产中在生产中不起作用,而在开发中却可以正常工作?虽然,我应该提到icon.js文件无法正常工作,我必须在标题中为其添加CDN链接.

BUT why does simply dropping JS, CSS, and icon.js files in asset not work in production but work just fine in development? Although, I should mention that icon.js file was not working and I had to add a CDN link for it in the header.

我非常感谢您的回答.

I'd really appreciate an answer.

这篇关于用户界面不同-部署中未显示图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆