vue项目 样式动态渲染_渲染样式

news/2024/7/10 3:13:47 标签: vue, java, javascript, css, html
htmledit_views">
<a class=html" title=vue>vue项目 样式动态渲染" width="403px" height="256px" style="outline: none;" />

html" title=vue>vue项目 样式动态渲染

The question is - what will a browser do, given a page with several stylesheets, each of them probably overwriting definitions from the previous ones? Will the browser render the page using the first received html" title=css>css file, while downloading the other ones and after that partially re-rendering where required? The answer is: no, the browser will wait until all CSS files are downloaded, (then probably merge all definitions, just a wild guess) and will render once.

问题是-给定一个页面包含多个样式表的情况下,浏览器将如何处理,每个样式表可能会覆盖先前样式表的定义? 浏览器是否会在下载其他文件时使用接收到的第一个CSS文件来渲染页面,然后在需要时部分重新渲染? 答案是:不会,浏览器将等到所有CSS文件下载完毕(然后可能会合并所有定义,只是一个疯狂的猜测),并将呈现一次。

测试 (Test)

I did this test - one page with two stylesheets that contain pretty much the same selectors for different table styles (thanks to this gallery). Each of the CSS files is actually a PHP script and has a call to sleep(), one sleeps for 5 seconds, the other one for 10.

我进行了此测试-一页包含两个样式表,其中包含几乎相同的选择器,用于不同的表格样式(感谢此Gallery )。 每个CSS文件实际上都是一个PHP脚本,并调用了sleep() ,一个睡眠5秒钟,另一个睡眠10秒钟。

结果 (Result)

The browser sits there and waits for the both styles, rendering nothing (except for the page title, but that's not really rendering, is it?). So nothing happens for 10 seconds, then the second style is used for the final rendering. This happens in both FF and IE.

浏览器坐在那儿,等待这两种样式,什么都不呈现(页面标题除外,但这不是真正的呈现,是吗?)。 因此10秒钟没有任何React,然后将第二种样式用于最终渲染。 在FF和IE中都会发生这种情况。

杂项 (Misc)

I also tried sleeping in the actual page, and flushing the output after each row. In my home environment FF renders each row as it's received, but in my hosted environment, it waits for the whole table. IE alsways waits for the complete table.

我还尝试在实际页面中Hibernate,并在每一行之后刷新输出。 在我的家庭环境中,FF会在接收到每一行时对其进行渲染,但是在我的托管环境中,它将等待整个表。 IE始终等待完整的表。

If I put the page to too much sleep so that the php script dies before the second stylesheet is dowloaded, the browser uses whatever is at hand (html" title=css>css1) to render the page.

如果我让页面睡得太多,以致php脚本在下载第二个样式表之前就死了,那么浏览器将使用手头的任何东西(html" title=css>css1)来呈现页面。

演示/下载 (Demo/download)

  • the actual test - two CSS files, first one sleeping 5 seconds, the other one 10

    实际测试-两个CSS文件,第一个CSS睡眠5秒,另一个10

  • table with no styles, sleeping 1 second after each row

    没有样式的桌子,每排睡一秒钟

  • table with html" title=css>css1 only, html" title=css>css sleeps 5 seconds

    仅具有html" title=css>css1的表,html" title=css>css睡眠5秒

  • zipped test for your testing pleasure

    压缩测试为您带来测试乐趣

Tell your friends about this post on Facebook and Twitter

在Facebook和Twitter上告诉您的朋友有关此帖子的信息

翻译自: https://www.phpied.com/rendering-styles/

html" title=vue>vue项目 样式动态渲染


http://www.niftyadmin.cn/n/1306602.html

相关文章

HighCharts之2D带Label的折线图

HighCharts之2D带Label的折线图 1、HighCharts之2D带Label的折线图源码 LineLabel.html&#xff1a; <!DOCTYPE html> <html> <head> <meta charset"UTF-8"> <title>HighCharts 2D带Label的折线图</title> <script type&quo…

java寻优算法_模拟退火算法SA原理及python、java、php、c++语言代码实现TSP旅行商问题,智能优化算法,随机寻优算法,全局最短路径...

模拟退火算法SA原理及python、java、php、c语言代码实现TSP旅行商问题&#xff0c;智能优化算法&#xff0c;随机寻优算法&#xff0c;全局最短路径模拟退火算法(Simulated Annealing&#xff0c;SA)最早的思想是由N. Metropolis等人于1953年提出。1983 年,S. Kirkpatrick 等成…

Ackerman函数 非递归 java_每天刷个算法题20160524:阿克曼函数的递归转非递归解法...

版权所有。所有权利保留。欢迎转载&#xff0c;转载时请注明出处&#xff1a;为了防止思维僵化&#xff0c;每天刷个算法题。已经刷了几天了&#xff0c;现在发点代码。我已经建了一个开源项目&#xff0c;每天的题目都在里面&#xff1a;绝大部分算法都是我自己写的&#xff0…

HighCharts之2D含有负值的面积图

HighCharts之2D含有负值的面积图 1、HighCharts之2D含有负值的面积图源码 AreaNegative.html&#xff1a; <!DOCTYPE html> <html> <head> <meta charset"UTF-8"> <title>HighCharts 2D含有负值的面积图</title> <script ty…

java 磁力下载工具_它可能是现在最好用的磁力下载工具

它可能是现在最好用的磁力下载工具2020-10-23 10:56:5167点赞988收藏50评论关于磁力下载、在线播放工具&#xff0c;我知道这一直都是广大老司机们的最爱&#xff0c;虽然我基本不用手机观影&#xff0c;不过后台关于这种需求每隔一段时间都会有询问。这样的工具一般可遇不可求…

HighCharts之2D堆面积图

HighCharts之2D堆面积图 1、HighCharts之2D堆面积图源码 StackedArea.html&#xff1a; <!DOCTYPE html> <html> <head> <meta charset"UTF-8"> <title>HighCharts 2D堆面积图</title> <script type"text/javascript&q…

HighCharts之2D数值带有百分数的面积图

HighCharts之2D数值带有百分数的面积图 1、HighCharts之2D数值带有百分数的面积图源码 AreaPercentage.html&#xff1a; <!DOCTYPE html> <html> <head> <meta charset"UTF-8"> <title>HighCharts 2D数值带有百分数的面积图</tit…

php模板缓存_PHP文件缓存smarty模板应用实例分析

本文实例分析了PHP文件缓存smarty模板应用。分享给大家供大家参考&#xff0c;具体如下&#xff1a;一、使用缓存要开启smarty的缓存,只需将caching设为true,并指定cache_dir即可.使用cache_lefetime指定缓存生存时间,单位为秒要对相同页面生成多个不同的缓存,在display或fetch…