mirror of
https://github.com/owntone/owntone-server.git
synced 2025-04-24 12:30:38 -04:00
41 lines
707 B
Vue
41 lines
707 B
Vue
<template>
|
|
<a :class="{ 'is-dark': is_shuffle }" @click="toggle">
|
|
<mdicon
|
|
class="icon"
|
|
:name="icon"
|
|
:size="16"
|
|
:title="$t(`player.button.${icon}`)"
|
|
/>
|
|
</a>
|
|
</template>
|
|
|
|
<script>
|
|
import { usePlayerStore } from '@/stores/player'
|
|
import webapi from '@/webapi'
|
|
|
|
export default {
|
|
name: 'ControlPlayerShuffle',
|
|
setup() {
|
|
return {
|
|
playerStore: usePlayerStore()
|
|
}
|
|
},
|
|
computed: {
|
|
icon() {
|
|
if (this.is_shuffle) {
|
|
return 'shuffle'
|
|
}
|
|
return 'shuffle-disabled'
|
|
},
|
|
is_shuffle() {
|
|
return this.playerStore.shuffle
|
|
}
|
|
},
|
|
methods: {
|
|
toggle() {
|
|
webapi.player_shuffle(!this.is_shuffle)
|
|
}
|
|
}
|
|
}
|
|
</script>
|