事件绑定:v-on:
属性绑定 v-bind:
双向绑定:v-model 实现数据的双向绑定
效果如下:
a.属性绑定

b.双向数据绑定
b1.
b2.
<div id="root">
<div v-on:click="clicks">{{title}}</div>
<div @click="clicks">{{title}}</div>
<div title="hello!">{{title}}</div>
<div title="title">{{title}}</div>
<div v-bind:title="title">{{title}}</div>
<div :title="title">{{title}}</div>
<input type="text" :value="msg"/>
<div>{{msg}}</div>
v-model ,效果如b2-->
<input type="text" v-model="msg"/>
<div>{{msg}}</div>
</div>
<script>
new Vue({
el:"#root",
data:{
title:"小丸子君",
msg:"厉害了!大佬!"
},
methods: {
clicks: function() {
this.title = "楚洁自话啊哈哈哈~~~~"
}
}
});
</script>