I have a role for a specific user with these numbers.
- Instead of number 1 it will display the word "Super Admin"
- Instead of number 2 it will display the word "Admin"
- Instead of number 2 it will display the word "User" and so on.
I am using q-table
<q-table
flat
bordered
title="USERS"
:data="allUsers"
:columns="columns"
:filter="filter"
:pagination.sync="initialPagination"
row-key="id"
>
<template v-slot:top-right>
<q-input
outlined
dense
debounce="300"
placeholder="Search"
v-model="filter"
>
<template v-slot:append>
<q-icon name="search" />
</template>
</q-input>
<div class="q-pa-sm q-gutter-sm"></div>
<q-btn
outline
color="white"
text-color="black"
@click="openCreateUserModal"
label="Create Users"
/>
</template>
<template v-slot:body="props">
<q-tr :props="props">
<q-td
v-for="col in props.cols.filter(col => col.name !== 'actions')"
:key="col.name"
>
{{ col.value }}
</q-td>
<td key="actions">
<q-btn dense flat color="primary" field="edit" icon="edit" />
<q-btn
dense
flat
color="negative"
field="delete"
icon="delete"
/>
</td>
</q-tr>
</template>
</q-table>
The role in my column
{
name: "role",
align: "center",
label: "Role",
field: "role",
sortable: true
},
Is this possible what I'm trying to achieve?
