vue.js v-bind使用,v-bind使用例子
阿新 • • 發佈:2018-11-29
vue.js v-bind使用,v-bind使用例子
================================
©Copyright 蕃薯耀 2018年11月29日
http://fanshuyao.iteye.com/
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>vue 資料繫結</title> </head> <body> <div id="vue-div"> 使用(v-bind:) <img v-bind:src="imgUrl" style="width: 50px;height: 50px;display: block;"/> 使用(:src),簡寫方式 <img :src="imgUrl" style="width: 50px;height: 50px;"/> </div> <script type="text/javascript" src="../js/vue.min.js"></script> <script type="text/javascript"> var app = new Vue({ el: "#vue-div", data: { msg : "aabbdDD-Hello-World", imgUrl : "https://cn.vuejs.org/images/logo.png" } }); </script> </body> </html>
================================
©Copyright 蕃薯耀 2018年11月29日
http://fanshuyao.iteye.com/