koel/resources/assets/js/components/main-wrapper/extra/lyrics.vue

42 lines
928 B
Vue
Raw Normal View History

2015-12-13 04:42:28 +00:00
<template>
<div id="lyrics">{{{ lyrics }}}</div>
</template>
<script>
import songStore from '../../../stores/song';
export default {
data() {
return {
lyrics: '',
};
},
events: {
/**
* Whenever a song is played, get its lyrics from store to display.
*
* @param object song The currently played song
2015-12-14 09:52:18 +00:00
*
2015-12-13 04:42:28 +00:00
* @return true
*/
'song:play': function (song) {
this.lyrics = 'Loading…';
2015-12-14 13:13:12 +00:00
songStore.getLyrics(song, () => this.lyrics = song.lyrics);
2015-12-13 04:42:28 +00:00
return true;
},
},
}
</script>
<style lang="sass">
@import "resources/assets/sass/partials/_vars.scss";
@import "resources/assets/sass/partials/_mixins.scss";
#lyrics {
color: $color2ndText;
}
</style>