首页 > Web开发 > 详细

vuejs组件通信

时间:2017-04-08 13:34:50      阅读:175      评论:0      收藏:0      [点我收藏+]
<body>

    <div id="example">
        <father></father>
    </div>
</body>
<script>
    Vue.component(child, {
        // 声明 props
        props: [message],
        // 就像 data 一样,prop 可以用在模板内
        // 同样也可以在 vm 实例中像 “this.message” 这样使用
        template: <span>{{ message }}</span>
    })


    Vue.component(father, {
        template: <child message="hello!"></child>
    })

    new Vue({
        el: #example
    })
</script>

</html>

 

vuejs组件通信

原文:http://www.cnblogs.com/thankyouGod/p/6681615.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!