Last active
July 5, 2019 18:25
-
-
Save burkeholland/df47fe3c9860e057dce50d012cffa5c3 to your computer and use it in GitHub Desktop.
This file contains 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> | |
<div class="section"> | |
<h1 class="is-size-1">Photos</h1> | |
<div class="columns is-multiline"> | |
<div | |
v-for="photo in photos" | |
:key="photo.id" | |
class="column is-one-quarter" | |
> | |
<div class="card photo"> | |
<div class="card-image"> | |
<figure class="image"> | |
<img :src="photo.url" alt="photo.title" /> | |
</figure> | |
</div> | |
<div class="card-content"> | |
<div class="content"> | |
<p>{{ photo.title }}</p> | |
</div> | |
</div> | |
</div> | |
</div> | |
</div> | |
</div> | |
</template> | |
<script> | |
export default { | |
async asyncData({ $axios }) { | |
const { data } = await $axios.get( | |
'https://jsonplaceholder.typicode.com/photos?_limit=100' | |
) | |
return { photos: data } | |
} | |
} | |
</script> | |
<style> | |
.card.photo { | |
height: 100%; | |
} | |
</style> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment