xxxxxxxxxx
const roleIdToRoleName = {
1: "Super Admin",
2: "Admin",
3: "User"
}
{
name: "role",
align: "center",
label: "Role",
field: "role",
sortable: true,
format: (val, row) => roleIdToRoleName[val]
},
xxxxxxxxxx
const getCellValue(row, col) {
const val = typeof col.field === 'function' ? col.field(row) : row[col.field]
return col.format ? col.format(val, row) : val
}
xxxxxxxxxx
<q-td :props="props" // !! you are missing props here
v-for="col in props.cols.filter(col => col.name !== 'actions')"
:key="col.name"
>
{{ getCellValue(props.row, col) }}
</q-td>