🐛(table): 修复 treetable 的 slots 的参数 data 不正确问题

This commit is contained in:
就眠儀式
2022-07-05 16:24:36 +08:00
parent 6fc3dc44f8
commit dc56a071b7
3 changed files with 9 additions and 8 deletions

View File

@@ -258,7 +258,7 @@ const childrenIndentSize = props.currentIndentSize + props.indentSize;
<!-- 嵌套表单 -->
<tr class="layui-table-cell-expand" v-if="slot.expand && isExpand">
<slot name="expand"></slot>
<slot name="expand" :data="data"></slot>
</tr>
<!-- 树形结构 -->
@@ -286,10 +286,10 @@ const childrenIndentSize = props.currentIndentSize + props.indentSize;
@contextmenu="contextmenu"
v-model:selectedKeys="tableSelectedKeys"
>
<template v-for="name in slotsData" #[name]>
<template v-for="name in slotsData" #[name]="{ data }">
<slot :name="name" :data="data"></slot>
</template>
<template v-if="slot.expand" #expand>
<template v-if="slot.expand" #expand="{ data }">
<slot name="expand" :data="data"></slot>
</template>
</table-row>

View File

@@ -400,7 +400,7 @@ props.dataSource.map((value: any) => {
</colgroup>
<tbody>
<!-- 渲染 -->
<template v-for="(data, index) in tableDataSource" :key="data">
<template v-for="(data, index) in tableDataSource" :key="index">
<table-row
:id="id"
:index="index"
@@ -420,10 +420,10 @@ props.dataSource.map((value: any) => {
@contextmenu="contextmenu"
v-model:selectedKeys="tableSelectedKeys"
>
<template v-for="name in slotsData" #[name]>
<template v-for="name in slotsData" #[name]="{ data }">
<slot :name="name" :data="data"></slot>
</template>
<template v-if="slot.expand" #expand>
<template v-if="slot.expand" #expand="{ data }">
<slot name="expand" :data="data"></slot>
</template>
</table-row>