子组件模版
<div>
<slot name="header"></slot>
<slot name="footer"></slot>
<slot></slot>
</div>
父组件模板
<my-component>
<p>Lack of anonymous slot, this paragraph will not shown.</p>
<p slot="footer">Here comes the footer content</p>
<p slot="header">Here comes the header content</p>
</my-component>
vue slot
最新推荐文章于 2024-04-17 10:15:31 发布