簡體   English   中英

Angular應用需要一段時間才能應用CSS

[英]Angular app taking a while to apply CSS

我正在研究的有角度的應用程序需要一段時間才能應用CSS。 首次加載(或通過刷新)任何頁面時,所有內容均顯示為原始html(無序列表等),例如: 在此處輸入圖片說明

這是網絡日志: 在此處輸入圖片說明 在此處輸入圖片說明 在此處輸入圖片說明

不知道這是什么根本原因,什么是最好的解決方法。

解決該問題的最佳方法是使用加載的.gif文件,該文件將一直顯示到頁面的所有元素都加載完畢為止。

的HTML

<!-- Loading div with some CSS and possibly text to let the user know the page is loading -->
<div class="loading"></div> 

<!-- Content div which will have the hidden class removed after the page has been fully loaded and rendered -->
<div class="content hidden"></div>

當從.content中刪除隱藏的類時,應將其應用於.loading

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM