Skip to content

Instantly share code, notes, and snippets.

@potato4d
Created October 10, 2017 07:26
Show Gist options
  • Save potato4d/133631f9987fccee61ad115b9cc16192 to your computer and use it in GitHub Desktop.
Save potato4d/133631f9987fccee61ad115b9cc16192 to your computer and use it in GitHub Desktop.
<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