Vue v-bind
来源:互联网 发布:手机淘宝如何找旗舰店 编辑:程序博客网 时间:2024/05/19 06:15
图片处理
<!DOCTYPE html><html><head> <meta charset="utf-8"> <title></title> <script src="../js/Vue.js" charset="utf-8"></script> <script type="text/javascript"> window.onload = function () { var vm = new Vue({ el: '#box', data: { url:'../img/1.jpg', w100:'100px', t:"这是图片" } }); } </script></head><body><div id="box"> <img v-bind:src="url" v-bind:width="w100" v-bind:title="t"> <img :src="url" :width="w100" :title="t"></div></body></html>
v-bind class
<!DOCTYPE html><html><head> <meta charset="utf-8"> <title></title> <style> .red{ color: red; } .burlywood{ background: burlywood; } </style> <script src="../js/Vue.js" charset="utf-8"></script> <script type="text/javascript"> window.onload = function () { var vm = new Vue({ el: '#box', data: { red:'red', burlywood:'burlywood' } }); } </script></head><body><div id="box"> <p :class="[red,burlywood]">文字颜色</p></div></body></html>
<!DOCTYPE html><html><head> <meta charset="utf-8"> <title></title> <style> .red{ color: red; } .burlywood{ background: burlywood; } </style> <script src="../js/Vue.js" charset="utf-8"></script> <script type="text/javascript"> window.onload = function () { var vm = new Vue({ el: '#box', data: { } }); } </script></head><body><div id="box"> <p :class="{red:true,burlywood:true}">文字颜色</p></div></body></html>
<!DOCTYPE html><html><head> <meta charset="utf-8"> <title></title> <style> .red{ color: red; } .burlywood{ background: burlywood; } </style> <script src="../js/Vue.js" charset="utf-8"></script> <script type="text/javascript"> window.onload = function () { var vm = new Vue({ el: '#box', data: { r:true, b:true } }); } </script></head><body><div id="box"> <p :class="{red:r,burlywood:b}">文字颜色</p></div></body></html>
<!DOCTYPE html><html><head> <meta charset="utf-8"> <title></title> <style> .red{ color: red; } .burlywood{ background: burlywood; } </style> <script src="../js/Vue.js" charset="utf-8"></script> <script type="text/javascript"> window.onload = function () { var vm = new Vue({ el: '#box', data: { json:{ red:true, b:false } } }); } </script></head><body><div id="box"> <p :class="json">文字颜色</p></div></body></html>
v-bind style
<!DOCTYPE html><html><head> <meta charset="utf-8"> <title></title> <script src="../js/Vue.js" charset="utf-8"></script> <script type="text/javascript"> window.onload = function () { var vm = new Vue({ el: '#box', data: { } }); } </script></head><body><div id="box"> <p :style="{color:'aqua'}">文字颜色</p></div></body></html>
<!DOCTYPE html><html><head> <meta charset="utf-8"> <title></title> <script src="../js/Vue.js" charset="utf-8"></script> <script type="text/javascript"> window.onload = function () { var vm = new Vue({ el: '#box', data: { c:{color:'aqua'} } }); } </script></head><body><div id="box"> <p :style="[c]">文字颜色</p></div></body></html>
<!DOCTYPE html><html><head> <meta charset="utf-8"> <title></title> <script src="../js/Vue.js" charset="utf-8"></script> <script type="text/javascript"> window.onload = function () { var vm = new Vue({ el: '#box', data: { b:{color:'blue'}, a:{backgroundColor:'aqua'} } }); } </script></head><body><div id="box"> <p :style="[b,a]">文字颜色</p></div></body></html>
<!DOCTYPE html><html><head> <meta charset="utf-8"> <title></title> <script src="../js/Vue.js" charset="utf-8"></script> <script type="text/javascript"> window.onload = function () { var vm = new Vue({ el: '#box', data: { colors:{ color:'blue', backgroundColor:'aqua' } } }); } </script></head><body><div id="box"> <p :style="colors">文字颜色</p></div></body></html>
0 0
- Vue v-bind
- Vue之filters--v-bind
- Vue中的缩写:v-bind、v-on
- vue学习06--v-bind:class和v-bind:style
- vue学习01--v-bind:title/v-if/v-for
- 10-Vue指令之V-bind
- VUE指令-样式绑定v-bind
- vue.js学习笔记之v-bind,v-on
- vue.js之v-on与v-bind
- Vue.js使用v-bind绑定class时的注意事项
- 对于vue中的v-bind:class 中的一点总结
- vue.js学习笔记之属性绑定 v-bind
- Vue.js学习笔记:属性绑定 v-bind
- vue v-bind:class中属性使用引号
- Vue.js学习笔记:属性绑定 v-bind
- Vue.js v-bind遇到的数据渲染问题
- Vue用v-bind给标签属性赋值 src, href...
- vue中使用v-bind:class的选项卡
- [XJB出题] [线段树] [差分数组] [模拟] 掀桌子(reverse)
- python 打包工具
- CSS属性之margin
- SpringMVC之简单hello搭建
- 【蓝牙】关于iBeacon相关的文章总结
- Vue v-bind
- (转载)什么是 web 框架?
- 检测两个三角形是否有重叠面积/相交的方法
- Spring - Java/J2EE Application Framework 应用框架 第 9 章 DAO支持
- [LeetCode]2.Add Two Numbers
- Vue 模板
- 6: Longest Consecutive Sequence
- Spring - Java/J2EE Application Framework 应用框架 第 10 章 使用JDBC进行数据访问
- Vue 过滤器