🐛(table): 修复 treetable 的 slots 的参数 data 不正确问题
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user