1. 程式人生 > >vue組件-其他

vue組件-其他

back div bsp vue code meta end bow body

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({ data:{ msg:我是筆筒^_^ }, template:<h3>{{msg}}</h3> }); Vue.component(aaa,Aaa); 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({ data(){ return { msg:我是標題^^ }; }, template:<h3>{{msg}}</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({
            data(){
                return {
                    msg:我是標題^^
                };
            },
            methods:{
                change(){
                    this.msg=changed
                }
            },
            template:<h3 @click="change">{{msg}}</h3>
        });

        Vue.component(aaa,Aaa);


        var vm=new Vue({
            el:#box,
            data:{
                bSign:true
            }
        });

    </script>
</body>
</html>

vue組件-其他