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>
  • 相关阅读:
    CF1008D Pave the Parallelepiped
    Luogu P3324 [SDOI2015]星际战争
    Luogu P3157 [CQOI2011]动态逆序对
    CF1295E Permutation Separation
    位元算
    JavaScript 寻找数组中的第N大的元素
    JS常见的数组排序算法
    最新面试总结
    JavaScript BOM浏览器对象模型
    JavaScript DOM 事件
  • 原文地址:https://www.cnblogs.com/lanlanJser/p/7420938.html
Copyright © 2011-2022 走看看