2016-11-07 20:38:51 +00:00
|
|
|
<template>
|
|
|
|
<div class="user">
|
|
|
|
<h3>{{ name }}</h3>
|
2016-11-07 20:58:56 +00:00
|
|
|
<h4>@{{ username }}</h4>
|
2016-11-07 20:38:51 +00:00
|
|
|
<p>Email : {{ email }}</p>
|
2016-11-07 20:58:56 +00:00
|
|
|
<p><router-link to="/">List of users</router-link></p>
|
2016-11-07 20:38:51 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import axios from 'axios'
|
|
|
|
|
|
|
|
export default {
|
|
|
|
data ({ params }) {
|
|
|
|
return axios.get(`http://jsonplaceholder.typicode.com/users/${params.id}`)
|
|
|
|
.then((res) => res.data)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
2016-11-07 20:58:56 +00:00
|
|
|
<style scoped>
|
|
|
|
.user {
|
|
|
|
text-align: center;
|
|
|
|
margin-top: 100px;
|
|
|
|
font-family: sans-serif;
|
|
|
|
}
|
2016-11-07 20:38:51 +00:00
|
|
|
</style>
|