| 123456789101112131415161718192021222324252627282930313233343536373839 |
- <!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>
- <body>
- <div id="app">
- <my-com></my-com>
- <hi></hi>
- </div>
- <script src="./vue.js"></script>
- <script>
- Vue.component("my-com",{
- template: `<h1>你好</h1>`
- })
- const news = Vue.extend({
- template: `<ul>
- <li>111</li>
- <li>222</li>
- 3 <li>333</li>
- </ul>`
- })
- var app = new Vue({
- el:"#app",
- data:{
- },
- components:{
- hi:news
- }
- })
- /**
- * 全局组件
- * 局部组件
- */
- </script>
- </body>
- </html>
|