有两种用法
第一种用法
// 子组件
// 具名插槽
<template>
<slot name="pending"></slot>
</template>
// =====================分割线==================
// 父组件
// 遍历slot插槽
<template v-for="item in Object.keys($slots)" #[item]="scope">
<slot :name="item" v-bind="scope"></slot>
</template>
第二种用法
// 子组件
// 具名插槽
<template>
<slot name="pending"></slot>
</template>
// =====================分割线================== 这一种可以给爷组件使用子组件的插槽=====
// 父组件
//
<template name="pending">
<slot name="pending" v-bind="scope"></slot>
</template>
// 爷组件
<template name="pending">
<span>我出现的位置是子组件插槽的位置</span>
</template>