首页 > 其他 > 详细

子组件引用

时间:2017-10-27 19:40:12      阅读:194      评论:0      收藏:0      [点我收藏+]
<body>
    <div id="parent">
        <user-profile ref="profile"></user-profile>
    </div>
    <script>
        Vue.component(‘user-profile‘,{
            template:‘<div></div>‘
        })
        var parent = new Vue({
            el:"#parent"
        })
        var child = parent.$refs.profile
        console.log(child)
    </script>
</body>

 

子组件引用

原文:http://www.cnblogs.com/ItIsInteresting/p/7744877.html

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