收藏
回答

为什么这样不行?

components/ancestor.js (ancestor-component):

Component({
    relations: {
        "./descendant": {
            type: "descendant",
            linked() {
                console.log("linked");
            }
        }
    }
});


components/component.wxml (some-component):

<ancestor-component>
    <slot />
</ancestor-component>


components/descendant.js (descendant-component):

Component({
    relations: {
        "./ancestor": {
            type: "ancestor"
        }
    }
});


index.wxml:

<some-component>
    <descendant-component />
</some-component>


最后一次编辑于  11-08
回答关注问题邀请回答
收藏
问题标签