1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
| <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> <script src="js/vue.js"></script> </head> <body> <input v-model="msg"> <input v-model="msg" /> <br /> {{msg}} <br /> {{msg1}} <br /> {{msg2}} <br /> {{arr}} <br /> {{json.a+" "+json.b+" "+json.c}} <script> window.onload=function(){ new Vue({ el:'body', data:{ msg:'welcome vue', msg1:'vue hello', msg2:true, arr:["apple","banana","pear","orange"], json:{a:'I',b:'love',c:'you'}//json是Object,需要点语法在网页中显示出来 }, }); }; </script> </body> </html>
|