<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> </head> <div id="app"> <hello-world></hello-world> <hello-tom></hello-tom> <hello-geyao></hello-geyao> <test-com></test-com> </div> <body> <script type="text/javascript" src="./js/vue.js"></script> <script> Vue.component('test-com', { template: '<div>Test</div>' }) var HelloWorld = { data: function() { return { msg: 'HelloWorld' } }, template: '<div>{{msg}}</div>' }; var HelloTom = { data: function() { return { msg: 'HelloTom' } }, template: '<div>{{msg}}</div>' }; var HelloGeyao = { data: function() { return { msg: 'HelloGeyao' } }, template: '<div>{{msg}}</div>' }; var vm = new Vue({ el: '#app', data: { }, components: { 'hello-world': HelloWorld, 'hello-tom': HelloTom, 'hello-geyao': HelloGeyao } }); </script> </body> </html>

