| # |
First Name |
Last Name |
Username |
Role |
Country |
| 1 |
Alexander |
Orton |
@mdorton |
Admin |
USA |
| 2 |
John Deo |
Deo |
@johndeo |
User |
USA |
| 3 |
Randy Orton |
the Bird |
@twitter |
admin |
UK |
| 4 |
Randy Mark |
Ottandy |
@mdothe |
user |
AUS |
| 5 |
Ram Jacob |
Thornton |
@twitter |
admin |
IND |
table.component.html
<template>
<div>
<table>
<thead>
<tr>
<th>#</th>
<th>First Name</th>
<th>Last Name</th>
<th>Username</th>
<th>Role</th>
<th>Country</th>
</tr>
</thead>
<tbody>
<tr v-for="(user, index) in users" :key="index">
<td>{{ index + 1 }}</td>
<td>{{ user.firstName }}</td>
<td>{{ user.lastName }}</td>
<td>{{ user.username }}</td>
<td>{{ user.role }}</td>
<td>{{ user.country }}</td>
</tr>
</tbody>
</table>
</div>
</template>
<script setup>
const users = [
{ firstName: "Alexander", lastName: "Orton", username: "@mdorton", role: "Admin", country: "USA" },
{ firstName: "John Deo", lastName: "Deo", username: "@johndeo", role: "User", country: "USA" },
{ firstName: "Randy Orton", lastName: "the Bird", username: "@twitter", role: "admin", country: "UK" },
{ firstName: "Randy Mark", lastName: "Ottandy", username: "@mdothe", role: "user", country: "AUS" },
{ firstName: "Ram Jacob", lastName: "Thornton", username: "@twitter", role: "admin", country: "IND" }
]
</script>