v-bind 属性绑定
1.v-bind:title="title" 绑定谁和谁绑定。
2.v-bind:title="title" 简写::title="title"
<!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width" /> <script src="~/Scripts/vue/vue.js"></script> <title>Index</title> </head> <body> <div id="root" v-bind:title="title" v-on:click="handle"> {{msg}} </div> </body> </html> <script type="text/javascript"> new Vue({ el: "#root", data: { msg: "hello word", title: "我是标题" }, methods: { handle: function () { this.msg = "你好" } } }); </script>