Modification: Each slot used needs a template package, and slot="name" is changed to v-slot:name
The original way of writing:
//子组件
<template>
<div class="tab-bar-item">
<slot name="item-icon"></slot>
</div>
</template>
//父组件
<tab-bar-item>
<img slot="item-icon" src="../src/assets/img/tabbar/home.svg" alt="" />
</tab-bar-item>
Modified writing:
//父组件,子组件无需修改
<tab-bar-item>
<template v-slot:item-icon>
<img src="../src/assets/img/tabbar/home.svg" alt="" />
</template>
</tab-bar-item>