mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-30 09:27:13 +00:00
e7cc2757c3
Co-authored-by: Alexander Lichter <manniL@gmx.net>
42 lines
921 B
Vue
42 lines
921 B
Vue
<template>
|
|
<div>
|
|
<table class="table table-bordered">
|
|
<thead>
|
|
<tr>
|
|
<th>Avatar</th>
|
|
<th>Name</th>
|
|
<th>Title</th>
|
|
<th>Profile</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr v-for="(user, key) in users" :key="key">
|
|
<td>
|
|
<NuxtLink :to="{ path: `/users/${key}`}">
|
|
<img :src="user.avatar" class="rounded" alt="avatar">
|
|
</NuxtLink>
|
|
</td>
|
|
<td>{{ user.name }}</td>
|
|
<td>{{ user.title }}</td>
|
|
<td>
|
|
<NuxtLink :to="{ path: `/users/${key}`}">
|
|
View profile →
|
|
</NuxtLink>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import axios from '~/plugins/axios'
|
|
|
|
export default {
|
|
async asyncData () {
|
|
const { data: users } = await axios.get('users.json')
|
|
return { users }
|
|
}
|
|
}
|
|
</script>
|