在子组件中嵌套了table,父组件想利用<slot>传递内容给子组件的table,但不起作用
请教下原因哈。
以下是大致的代码场景
子组件mytable:
<template>
<div>
<Table :columns="lists">
<slot></slot>
</Table>
</div>
</template>
...js代码..
lists: [
{
title: "xxxxx",
key: "task_name",
slot: "task_name",
},
...js代码..
父组件调用子组件:
<mytable>
<template slot-scope="{ row }" slot="task_name">
<span>11111</span>
</template>
</matable>
主要在第二部分传递插槽这里,但我只会用render实现。