
Vue
Joris要为所欲为
Web前端
展开
-
Vue学习——v-text, v-cloak, v-html
1.v-cloakv-cloak用于隐藏页面还未加载完毕时的插值表达式。2.v-textv-text用于解决插值表达式的闪烁问题,但标签内部的innerHTML会被v-text内的值替换<h4 v-text="msg">=======</h4>页面中h4标签中的=====并没有被显示,而是被msg替换3.v-htmlv-html用于给标签绑定html脚...原创 2019-01-21 23:15:37 · 115 阅读 · 0 评论 -
Vue学习——v-bind
v-bind可以用v-bind:+属性或直接使用:绑定标签的属性<div id="bind_test"> <input type="button" :title="myTitle + '而且可以当做表达式'" value="按钮"> </div>var bind_test = new Vue({ el: "#bind_te原创 2019-01-21 23:24:53 · 160 阅读 · 0 评论 -
Vue学习——v-bind绑定class用法
1.通过v-bind可以为一个标签绑定多个类: .big{ font-size: 30px; } .italic{ font-style: italic } .red{ color:red; }<div id="bind_test2"> <p :class="['red', 'big', 'italic']">测试字符串</p>...原创 2019-01-22 22:03:39 · 1360 阅读 · 0 评论 -
Vue学习——v-bind绑定sytle
1.可以用v-bind绑定元素的style,传入一个对象。注意:如果css属性名称中有’ - '则必须加单引号(如font-weight),如果没有则可以不加<div id="bind_test3"> <h1 :style="{ 'color':'blue', 'font-weight' : 200 }">测试字符串</h1></div>...原创 2019-01-22 22:44:10 · 164 阅读 · 0 评论