1、v-bind: 属性绑定,简写为冒号“:”
绑定后属性为模板中属性
2、:value设置值
<input :value="content"/>
3、v-model双向数据绑定
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Vue学习</title>
<script src="./vue.js"></script>
</head>
<body>
<div id="root">
<div v-bind:title="title">{{title}}</div>
<input v-model="content"/>
<div>{{content}}</div>
</div>
<script>
new Vue({
el:"#root",
// template:'<h1>{{msg}}</h1>',
data:{
content:"hello world",
title:"this is hello world"
},
methods:{
handleClick:function () {
this.content = "world"
}
}
})
</script>
</body>
</html>