默认插槽
父
<Child >
<ui>
<li></li>
</ui>
</Child>
子
<template>
<div>
<slot>默认内容</slot> //如果这里父没有插槽内容,子会默认
</div>
</template>
有名插槽
父
<Child >
<template v-slot:s1> //插槽1 或者 #s1
<h2></h2>
</template>
<template v-slot:s2> //插槽2 或者 #s2
<ui>
<li>111</li>
</ui>
</template>
</Child>
子
<template>
<div>
<slot name="s1">默认内容</slot>
<slot name="s2">默认内容</slot> //如果这里父没有插槽内容,子会默认
</div>
</template>
作用域插槽
子组件需要给父组件传递参数
子
父
<Child >
<template v-slot="params">
<h2></h2>
</template>
</Child>