1 <html lang="en">
 2 
 3 <head>
 4     <meta charset="UTF-8">
 5     <meta name="viewport" content="width=device-width, initial-scale=1.0">
 6     <meta http-equiv="X-UA-Compatible" content="ie=edge">
 7     <title>V-model实现数据的双向绑定</title>
 8 </head>
 9 
10 <body>
11     <div id="app">
12         <p>{{msg}}</p>
13         <!-- v-bind只能实现单向绑定 -->
14         <!-- <input type="text" v-bind:value="msg"> -->
15         <!-- v-model 只能在表单中使用 -->
16         <input type="text" v-model="msg">
17 
18     </div>
19     <script src="../js/vue.js"></script>
20     <script>
21         var vm = new Vue({
22             el: "#app",
23             data: {
24                 msg: '我是一只猫猫'
25             },
26             methods: {
27 
28             }
29 
30         })
31     </script>
32 </body>
33 
34 </html>