1. 綁定 dom 屬性 :attr="var"javascript
<div id="active"> <img :src="banner"> </div> <script> active = new Vue({ el: '#active', data: { banner: '../img/banner.jpg' } }) </script>
2. 綁定樣式 v-bind:style="{ }"html
<div id="active"> <div v-bind:style="{ height: hig+'px' }"></div> </div> <script> active = new Vue({ el: '#active', data: { hig: 120 } }) </script>
3. 綁定 html 代碼 v-html="var"java
<div id="active"> 活動介紹: <div v-html="desc"></div> </div> <script> active = new Vue({ el: '#active', data: { desc: "活動時間<p>2018-10-10" } }) </script>
4. data 變量從新賦值dom
var active = new Vue({ el: '#active', data: { banner: '../img/banner.jpg' } }); active.banner = '../img/banner11.jpg';