| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 | 
							- <!DOCTYPE html>
 
- <html lang="en">
 
- <head>
 
-     <meta charset="UTF-8">
 
-     <meta name="viewport" content="width=device-width, initial-scale=1.0">
 
-     <title>Document</title>
 
-     <script src="./js/vue.js"></script>
 
-     <style>
 
-         .box {
 
-             width: 100px;
 
-             height: 100px;
 
-             background-color: red;
 
-             margin: 10px;
 
-         }
 
-         .box2 {
 
-             width: 100px;
 
-             height: 100px;
 
-             background-color: blue;
 
-             margin: 10px;
 
-         }
 
-     </style>
 
- </head>
 
- <body>
 
-     <div id="app">
 
-         <list-content></list-content>
 
-         <box></box>
 
-         <button @click="appHandle">button</button>
 
-     </div>
 
-     <template id="box-temp">
 
-         <div class="container">
 
-             <div @click="box1Handle" class="box">
 
-                 <span>hello world</span>
 
-             </div>
 
-             <div @click="box2Handle" class="box2">
 
-                 {{num}}
 
-             </div>
 
-         </div>
 
-     </template>
 
-     <template id="list-content">
 
-         <div class="container">
 
-             <ul>
 
-                 <li>1</li>
 
-                 <li>2</li>
 
-                 <li>3</li>
 
-                 <li>4</li>
 
-                 <li>5</li>
 
-             </ul>
 
-         </div>
 
-     </template>
 
-     <script>
 
-         let app = new Vue({
 
-             el: '#app',
 
-             data: {
 
-             },
 
-             methods: {
 
-                 appHandle() {
 
-                     console.log('appHandle')
 
-                 }
 
-             },
 
-             components: {
 
-                 listContent:{
 
-                     template:"#list-content",
 
-                 },
 
-                 box: {
 
-                     template: "#box-temp",
 
-                     // 组件内部的data是个函数 内部返回一个对象
 
-                     data() {
 
-                         return{
 
-                             num:"abcd"
 
-                         }
 
-                     },
 
-                     methods: {
 
-                         box1Handle() {
 
-                             console.log('box1Handle')
 
-                         },
 
-                         box2Handle(){
 
-                             console.log('box2Handle')
 
-                         }
 
-                     }
 
-                 }
 
-             }
 
-         })
 
-     </script>
 
- </body>
 
- </html>
 
 
  |