! DOCTYPE html html head title hello world vue / title meta charset ="utf-8" / / head body div id ="app" v-cloak !-- 缺省挂载 currentView 变量指定的组件 -- my-home / my-home / div / body / html script src ="jquery-3.1.1.js" / scr
<!DOCTYPE html> <html> <head> <title> hello world vue </title> <meta charset="utf-8" /> </head> <body> <div id="app" v-cloak> <!-- 缺省挂载 currentView 变量指定的组件 --> <my-home></my-home> </div> </body> </html> <script src="jquery-3.1.1.js"></script> <script src="vue.js"></script> <script> $(document).ready(function() { }); </script> <script> Vue.component(‘my-home‘, function(resolve, reject) { window.setTimeout(function() { resolve({ template: ‘<div>我是异步渲染的</div>‘ }); }, 2000); }); var app = new Vue({ el: ‘#app‘, data: {}, computed: {}, methods: {}, components: {}, mounted: function() {} }); </script>