LWC-002_Composition

Composition (lwc.dev)

Set a Property on a Child Component

# Send an Event from a Child to an Owner

 

实际上 我的理解是 parent 调用了 child的页面,实际上 child的参数是由 parent 传过来的

类似:调用另外一个class的方法,当然需要传参数

 

 

Slot:实际上是parent中的标签 在子组件中进行替换

<example-slot-wrapper>
    <example-slot-demo>
        <h1>Content in Slot Demo</h1>
        <div>
            <slot><p>Content from Slot Wrapper</p></slot>
        </div>
    </example-slot-demo>
</example-slot-wrapper>

  

posted @ 2023-02-22 10:50  BandariFang  阅读(10)  评论(0编辑  收藏  举报