Nuxt/examples/with-firebase/pages/users/_key.vue

24 lines
668 B
Vue
Raw Normal View History

2017-02-25 03:37:05 +00:00
<template>
<div class="card" style="width: 20rem;">
<div class="card-block">
<img :src="user.avatar" class="rounded" alt="avatar"> <br><br>
<h4 class="card-title">{{ user.name }}</h4>
<h6 class="card-subtitle mb-2 text-muted">{{ user.title }}</h6>
<p class="card-text">{{ user.description }}</p>
<a href="#" class="btn btn-primary">Hire {{ user.name.split(' ')[0] }}</a>
</div>
</div>
</template>
<script>
2017-10-19 09:25:19 +00:00
import axios from '~/plugins/axios'
2017-02-25 03:37:05 +00:00
export default {
2017-10-19 09:25:19 +00:00
async asyncData ({ route }) {
2017-02-25 03:37:05 +00:00
const { key } = route.params
2017-10-19 09:25:19 +00:00
const { data: user } = await axios.get(`users/${key}.json`)
return { user }
2017-02-25 03:37:05 +00:00
}
}
</script>