匿名:<slot></slot>
具名:<slot name="zhang"></slot>----<h3 slot="zhang">张三 --- 父组件</h3>
作用域:<slot name="zhang" :data="arr"></slot>---
<Child>
<template slot="zhang" slot-scope="item"> //需要使用 template 包裹
<div v-for="num in item.data">
<p>{{num}}</p>
</div>
</template> //需要使用 template 包裹
</Child>
网友评论