您如何在分组表中访问这些标题的索引?
问问题
1465 次
2 回答
1
我才发现,答案就在图片中
{{props.row.vgt_id}}
于 2018-12-21T06:32:04.500 回答
0
您可以使用props.column
. props.column
将为您提供完整的列对象,以便您可以从中获取索引。props.column.field
会给你列名title。
- 您可以检查索引
props.column.originalIndex
- 可以通过访问原始行对象
props.row
- 当前显示的表格行索引可以通过 访问
props.index
。 original row index
可以通过访问props.row.originalIndex
。- 然后,您可以使用 访问原始行对象
rows[props.row.originalIndex]
。 - 可以通过以下方式访问列对象
props.column
- 您可以通过以下方式访问格式化的行数据(例如 - 格式化的日期)
props.formattedRow
例如 :
<vue-good-table
:columns="columns"
:rows="rows">
<template slot="table-row" slot-scope="props">
<span v-if="props.column.field == 'age'">
<span style="font-weight: bold; color: blue;">{{props.row.age}}</span>
</span>
<span v-else>
{{props.formattedRow[props.column.field]}}
</span>
</template>
</vue-good-table>
于 2018-12-21T06:26:12.547 回答