【发布时间】:2021-10-20 22:40:29
【问题描述】:
问题:我无法在我的数据表中添加可扩展行。没有显示。
目标:我需要在我的数据表中使用可展开的行填充一些数据。
我尝试过的:我已按照文档here is the reproducible code that you can access on codepen 进行操作。您可以在取消注释填充我的数据表的代码后看到,可扩展行不再可见。
用于添加可展开行的代码:
<template v-slot:top>
<v-toolbar flat>
<v-toolbar-title>Data</v-toolbar-title>
<v-spacer></v-spacer>
<v-switch v-model="singleExpand" label="Single expand" class="mt-2"></v-switch>
</v-toolbar>
</template>
<template v-slot:expanded-item="{ headers, item }">
<td :colspan="headers.length">More info about {{ item.name }}</td>
</template>
用于在数据表中添加数据的代码:
<!-- <template v-slot:body="props">
<tr v-for="index in props.items" :key="index.Info">
<td id="table-data" v-for="header in headers" :key="header.Info" class="text-left">
{{ index.packetParsed[header.value] }}
</td>
</tr>
</template> -->
注意:请注意,我无法更改从数据库中检索的数据结构。
【问题讨论】:
标签: vue.js datatable row expandable