v-bind 動態綁定class
<h2 v-bind:class=“{active:isActive,line:isLine}”>{{message}}</h2>
<button @click=‘btnClick’>按鈕</button>
data:{
message:’hello’,
isActive:true,
inLine:true
},
methods:{
//點擊過程改變狀態
btnClick:function(){
this.isActive = !this.isActive ,
}
v-bind 動態綁定屬性
<img v-bind:arc=“imgURL” alt=“”>
<a v-bind:href=“hello”>百度一下啊</a>
date:{
message:’hello world’,
imgURL:’http://xxxx/xxx.com’,
hello:’http://baidu.com’
}