2016-11-07 20:38:51 +00:00
|
|
|
<template>
|
2016-11-07 20:58:56 +00:00
|
|
|
<div class="container">
|
2016-11-07 20:38:51 +00:00
|
|
|
<h2>Users</h2>
|
2016-11-07 20:58:56 +00:00
|
|
|
<ul class="users">
|
2016-12-11 01:44:40 +00:00
|
|
|
<!-- <li v-for="user in users">
|
2016-11-07 20:58:56 +00:00
|
|
|
<router-link :to="{ name: 'user', params: { id: user.id } }">{{ user.name }}</router-link>
|
2016-12-11 01:44:40 +00:00
|
|
|
</li> -->
|
2016-11-07 20:58:56 +00:00
|
|
|
</ul>
|
|
|
|
</div>
|
2016-11-07 20:38:51 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2016-12-11 01:44:40 +00:00
|
|
|
// import axios from 'axios'
|
2016-11-07 20:38:51 +00:00
|
|
|
|
|
|
|
export default {
|
2016-12-11 01:44:40 +00:00
|
|
|
// data () {
|
|
|
|
// return axios.get('https://jsonplaceholder.typicode.com/users')
|
|
|
|
// .then((res) => {
|
|
|
|
// return { users: res.data }
|
|
|
|
// })
|
|
|
|
// }
|
2016-11-07 20:38:51 +00:00
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
2016-11-07 20:58:56 +00:00
|
|
|
<style scoped>
|
|
|
|
.container {
|
|
|
|
text-align: center;
|
|
|
|
margin-top: 100px;
|
|
|
|
font-family: sans-serif;
|
|
|
|
}
|
|
|
|
.users {
|
|
|
|
list-style-type: none;
|
|
|
|
}
|
|
|
|
.users li a {
|
|
|
|
display: inline-block;
|
|
|
|
width: 200px;
|
|
|
|
border: 1px #ddd solid;
|
|
|
|
padding: 10px;
|
|
|
|
text-align: left;
|
|
|
|
color: #222;
|
|
|
|
text-decoration: none;
|
|
|
|
}
|
|
|
|
.users li a:hover {
|
|
|
|
color: orange;
|
|
|
|
}
|
2016-11-07 20:38:51 +00:00
|
|
|
</style>
|