

在子组件中只能有一个

结果:

#b是v-slot:b 的缩写顾名思义就是指着名字去插入

结果:


<template>
<test3 :data="testData">
<template v-slot="{$a,b}">
<span :style="{backgroundColor:$a.todo?'red':'blue'}">
第{{b}}条数据:内容是{{ $a }}
span>
template>
test3>
template>
:父组件没有使用该标签时<slot>当父组件没有数据要插入时,这里显示本语句slot>