<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> </head> <body> <div id="app"> {{ msg }} </div> </body> <script src="js/vue.js"></script> <script> var app = new Vue({ el: '#app', data: { msg: "今晚嘿嘿" } }); // 如果需要使用vue对象(实例), 那么久可以接受Vue创建的结果, 反之就不需要接收 console.log(app); console.log(app.$attrs); // vue实例的变量都是以$开头 console.log(app.$el); console.log(app.$data.msg); console.log(app.msg); // app对象 = new Vue()实例 = 标签div#app组件 </script> </html>