zoukankan      html  css  js  c++  java
  • vue-组件

    1

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Document</title>
        <script src="bower_components/vue/dist/vue.js"></script>
        <style>
        </style>
    </head>
    <body>
        <div id="box">
            <!-- <aaa></aaa> -->
        </div>
    
        <script>
            var Aaa=Vue.extend({
                template:'<h3>我是标题3</h3>'
            });
    
            var a=new Aaa();
            console.log(a);
    
    
            var vm=new Vue({
                el:'#box',
                data:{
                    bSign:true
                }
            });
    
        </script>
    </body>
    </html>

    2

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Document</title>
        <script src="bower_components/vue/dist/vue.js"></script>
        <style>
        </style>
    </head>
    <body>
        <div id="box">
            <aaa></aaa>
        </div>
    
        <script>
            var Aaa=Vue.extend({
                template:'<h3>我是标题3</h3>'
            });
    
            Vue.component('aaa',Aaa);
    
    
            var vm=new Vue({
                el:'#box',
                data:{
                    bSign:true
                }
            });
    
        </script>
    </body>
    </html>

    3

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Document</title>
        <script src="bower_components/vue/dist/vue.js"></script>
        <style>
        </style>
    </head>
    <body>
        <div id="box">
            <aaa></aaa>
        </div>
    
        <script>
            var Aaa=Vue.extend({
                template:'<h3>{{msg}}</h3>',
                data(){
                    return {
                        msg:'ddddd'
                    }
                }
            });
    
    
            var vm=new Vue({
                el:'#box',
                data:{
                    bSign:true
                },
                components:{ //局部组件
                    aaa:Aaa
                }
            });
    
        </script>
    </body>
    </html>

    4

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Document</title>
        <script src="bower_components/vue/dist/vue.js"></script>
        <style>
        </style>
    </head>
    <body>
        <div id="box">
            <my-aaa></my-aaa>
        </div>
    
        <script>
            var Aaa=Vue.extend({
                template:'<h3>{{msg}}</h3>',
                data(){
                    return {
                        msg:'ddddd'
                    }
                }
            });
    
    
            var vm=new Vue({
                el:'#box',
                data:{
                    bSign:true
                },
                components:{ //局部组件
                    'my-aaa':Aaa
                }
            });
    
        </script>
    </body>
    </html>
  • 相关阅读:
    Backbone Events 源码笔记
    IIS8集成模式下打开静态资源被aspx处理程序处理,StaticFileModule失效问题分析
    Orchard 与 ABP架构比较 (aspnetboilerplate)
    Orchard EventBus 事件总线及 IEventHandler作用
    Orchard 事件通知小坑
    推荐一个国内编程语言排名网站
    po_文件格式[转]
    关于poedit打开po文件乱码的问题
    JAVA和.NET工作流相关项目收集
    php里的二进制安全
  • 原文地址:https://www.cnblogs.com/lanlanJser/p/7420938.html
Copyright © 2011-2022 走看看