Created
October 10, 2017 07:26
-
-
Save potato4d/133631f9987fccee61ad115b9cc16192 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<section class="container"> | |
<img :src="`https://github.com/${user.login}.png`" :alt="user.name"> | |
<h1>{{user.name}}</h1> | |
</section> | |
</template> | |
<script> | |
import axios from 'axios' | |
export default { | |
async asyncData ({ params }) { | |
const { data: user } = await axios.get(`https://api.github.com/users/${params.id}`) | |
return { | |
user | |
} | |
} | |
} | |
</script> | |
<style> | |
.container { | |
min-height: 100vh; | |
display: flex; | |
justify-content: center; | |
align-items: center; | |
text-align: center; | |
flex-direction: column; | |
} | |
.container img{ | |
margin-bottom: 20px; | |
border-radius: 50%; | |
overflow: hidden; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment