fix: table row index error

This commit is contained in:
w940853815
2025-02-19 11:01:35 +08:00
committed by w940853815
parent c1b60e6298
commit 6357056600
3 changed files with 5 additions and 4 deletions

View File

@@ -105,14 +105,14 @@
<template #header>
<span :title="col.label">{{ col.label }}</span>
</template>
<template v-if="col.formatter && typeof col.formatter !== 'function'" v-slot:default="{row, column, index}">
<template v-if="col.formatter && typeof col.formatter !== 'function'" v-slot:default="{row, column, $index}">
<div
:is="col.formatter"
:key="row.id"
:cell-value="row[col.prop]"
:col="col"
:column="column"
:index="index"
:index="$index"
:reload="getList"
:row="row"
:table-data="data"

View File

@@ -74,7 +74,8 @@ export default {
return this.formatterArgs.getTitle({
col: this.col,
row: this.row,
cellValue: this.cellValue
cellValue: this.cellValue,
index: this.index
})
},
disabled() {

View File

@@ -54,7 +54,7 @@ export default {
formatterArgs: {
drawer: true,
can: this.$hasPerm('assets.view_asset'),
getTitle: ({ row }) => { return row.id },
getTitle: ({ row, col, cellValue, index }) => { return index + 1 },
getRoute: ({ row }) => {
return {
name: 'SessionDetail',