Created
April 18, 2019 14:22
-
-
Save magyarn/7b64a2b4e47cd9fa9a2ae6f62bdf4125 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> | |
... | |
</template> | |
<script> | |
import flickr from '../flickr.js' | |
export default { | |
name: 'imageDetail', | |
props: { | |
id: String, | |
}, | |
created() { | |
this.fetchImageInfo() | |
this.fetchImageSizes() | |
}, | |
data() { | |
return { | |
imageInfo: null, | |
imageUrl: null, | |
} | |
}, | |
computed: { | |
... | |
}, | |
methods: { | |
... | |
fetchImageSizes() { | |
return flickr('photos.getSizes', { photo_id: this.id }).then(response => { | |
let sizes = response.data.sizes.size | |
this.imageUrl = sizes.filter(s => s.label === "Large")[0].source | |
}) | |
} | |
} | |
} | |
</script> | |
<style> | |
... | |
</style> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment