Use computed for bio panel

This commit is contained in:
An Phan 2016-10-31 11:34:08 +07:00
parent f08f04f594
commit 6abc8431a4
No known key found for this signature in database
GPG key ID: 05536BB4BCDC02A2

View file

@ -12,11 +12,10 @@
class="cool-guys-posing cover">
<div class="bio" v-if="artist.info.bio.summary">
<div class="summary" v-show="mode !== 'full' && !showingFullBio" v-html="artist.info.bio.summary"/>
<div class="full" v-show="mode === 'full' || showingFullBio" v-html="artist.info.bio.full"/>
<div class="summary" v-show="showSummary" v-html="artist.info.bio.summary"/>
<div class="full" v-show="showFull" v-html="artist.info.bio.full"/>
<button class="more" v-show="mode !== 'full' && !showingFullBio"
@click.prevent="showingFullBio = !showingFullBio">
<button class="more" v-show="showSummary" @click.prevent="showingFullBio = true">
Full Bio
</button>
</div>
@ -47,6 +46,16 @@ export default {
},
},
computed: {
showSummary() {
return this.mode !== 'full' && !this.showingFullBio;
},
showFull() {
return this.mode === 'full' || this.showingFullBio;
}
},
methods: {
/**
* Shuffle all songs performed by the current song's artist.