Skip to content

Instantly share code, notes, and snippets.

@fernyettheplant
Created April 14, 2018 22:12
Show Gist options
  • Save fernyettheplant/5f76312c93a82e6056fd69cb0b89706d to your computer and use it in GitHub Desktop.
Save fernyettheplant/5f76312c93a82e6056fd69cb0b89706d to your computer and use it in GitHub Desktop.
<template>
<div class="indexMargin">
<h1>This is the Front Page.</h1>
<h3>The chosen one is called {{ chosenOne }}</h3>
</div>
</template>
<script>
import axios from 'axios';
export default {
async asyncData ({ params }) {
let { data } = await axios.get('https://swapi.co/api/people/1/')
return { chosenOne: data.name }
},
computed: {
theName () {
return this.name || 'anon'
}
},
head: {
link: [
{
rel: 'stylesheet', href: 'https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/1.11.8/semantic.min.css'
}
]
}
}
</script>
<style scoped>
.indexMargin {
margin: 15px
}
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment