Created
April 18, 2019 13:57
-
-
Save magyarn/103dbff43d600b4e39dba7d04474af70 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
<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