第一个Vus.js

 1 <!DOCTYPE html>
 2 <html>
 3 <head>
 4 <meta charset="utf-8">
 5 <title>第一个Vue.js</title>
 6   <!--<script src="vue.js"></script>-->
 7   <script src="https://unpkg.com/vue"></script>
 8 </head>
 9 <body>
10 
11   <div id="vue-app">
12     <h1>{{ name }}</h1>
13     <p><h1>{{ greet("花花世界") }}</h1></p>
14     <h1><a v-bind:href="urla">ViewModel    DOM Listeners    Data Bindings</a></h1>
15     <p><input type="text" v-bind:value="name"/></p>
16     <p v-html="websiteTag"></p>
17     <a href="https://unpkg.com/vue">aa</a>
18   </div>
19 
20   <script>
21 
22     new Vue({
23       el:"#vue-app",
24       data:{
25         name:"米开朗琪罗",    
26         age:1800,
27         urla:"http://www.baidu.com",
28         websiteTag:"<a href='http://www.baidu.com'>百度</a>",
29       },
30       methods:{
31         greet:function(time){
32           return "Good"+time+";"+this.name+",age:"+this.age;
33         }
34       }
35     });
36 
37   </script>
38 
39 <!--${ pageContext.request.contextPath}-->
40 

42 </body>
43 </html>
原文地址:https://www.cnblogs.com/sunduge/p/7902884.html