Added spotify player
This commit is contained in:
@ -9,7 +9,8 @@
|
||||
<b-row v-else>
|
||||
<b-col class="my-4">
|
||||
|
||||
<b-table :items="tracklist" :fields="fields" hover borderless @row-clicked="rowClicked" tbody-tr-class="clickable-table-row-thing">
|
||||
<b-table :items="tracklist" :fields="fields" hover borderless @row-clicked="rowClicked"
|
||||
tbody-tr-class="clickable-table-row-thing">
|
||||
<template #cell(cover_url)="data">
|
||||
<b-img-lazy :src="data.item.cover_url_small" height="45px" blank-src="@/assets/music_placeholder.png"
|
||||
v-if="!!data.item.cover_url_small"/>
|
||||
@ -18,7 +19,9 @@
|
||||
|
||||
<template #cell(id)="data">
|
||||
<div class="text-right">
|
||||
<b-button variant="success" :disabled="!data.item.spotify_id">Play</b-button>
|
||||
<b-button variant="success" :disabled="!data.item.spotify_id" @click="startPlayer(data.item.spotify_id)">
|
||||
Play
|
||||
</b-button>
|
||||
</div>
|
||||
</template>
|
||||
</b-table>
|
||||
@ -60,6 +63,9 @@ export default {
|
||||
methods: {
|
||||
rowClicked(data) {
|
||||
this.$router.push({name: 'Item', params: {id: data.id}});
|
||||
},
|
||||
startPlayer(spotify_id) {
|
||||
this.$store.dispatch('openPlayer', spotify_id);
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
Reference in New Issue
Block a user