Skip to content

Instantly share code, notes, and snippets.

@magyarn
Created April 18, 2019 13:57
Show Gist options
  • Save magyarn/103dbff43d600b4e39dba7d04474af70 to your computer and use it in GitHub Desktop.
Save magyarn/103dbff43d600b4e39dba7d04474af70 to your computer and use it in GitHub Desktop.
<script>
export default {
...
computed: {
title() {
if (this.imageInfo) {
return this.imageInfo.title._content || 'Untitled Image'
}
return ''
},
ownerName() {
if (this.imageInfo) {
return this.imageInfo.owner.username
}
return ''
},
description() {
if (this.imageInfo) {
return this.imageInfo.description._content || 'No description available.'
}
return ''
},
tags() {
if (this.imageInfo) {
return this.imageInfo.tags.tag
}
return []
}
},
...
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment