码迷,mamicode.com
首页 > 其他好文 > 详细

vue(2)-防止闪烁

时间:2017-07-10 22:01:04      阅读:179      评论:0      收藏:0      [点我收藏+]

标签:闪烁   ext   play   等价   css   style   括号   div   span   

1、使用 v-cloak来解决花括号闪烁,一般会用在比较大的段落

v-cloak直接加在代码里

css里:
[v-cloak]{display:none;}

2、{{msg}}   与 v-text=msg  等价

<span>{{msg}}</span>

<span v-text="msg"></span>  //防止闪烁

3、转义时{{{msg}}}  与 v-html等价

<span>{{{msg}}} </span>  //转义

<span v-html="msg"></span>  //防止闪烁

注:在vue 2.0 -- {{{}}} 这种写法已经删掉

vue(2)-防止闪烁

标签:闪烁   ext   play   等价   css   style   括号   div   span   

原文地址:http://www.cnblogs.com/sun927/p/7147362.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!