mirror of
https://github.com/tcsenpai/swingmusic.git
synced 2025-06-10 21:17:33 +00:00
fix play from sidebar queue
This commit is contained in:
parent
c9cd6a8067
commit
d114aa48cd
@ -51,6 +51,7 @@ const settings = useSettingsStore();
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
display: grid;
|
||||
gap: $small;
|
||||
grid-template-rows: max-content 1fr;
|
||||
}
|
||||
}
|
||||
|
@ -1,47 +1,39 @@
|
||||
<template>
|
||||
<QueueActions />
|
||||
<div class="scrollable-r">
|
||||
<div class="inner">
|
||||
<TrackComponent
|
||||
v-for="(t, index) in queue.tracklist"
|
||||
:key="index"
|
||||
:track="t"
|
||||
:index="index + 1"
|
||||
:isPlaying="queue.playing"
|
||||
:isHighlighted="false"
|
||||
:isCurrent="index === queue.currentindex"
|
||||
/>
|
||||
<QueueActions />
|
||||
<div
|
||||
class="scrollable-r"
|
||||
@mouseover="mouseover = true"
|
||||
@mouseout="mouseover = false"
|
||||
>
|
||||
<div class="inner">
|
||||
<TrackItem
|
||||
v-for="(t, index) in queue.tracklist"
|
||||
:key="index"
|
||||
:track="t"
|
||||
:index="index + 1"
|
||||
:isPlaying="queue.playing"
|
||||
:isHighlighted="false"
|
||||
:isCurrent="index === queue.currentindex"
|
||||
@PlayThis="playFromQueue(index)"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, onUpdated, ref } from "vue";
|
||||
import { onUpdated, ref } from "vue";
|
||||
|
||||
import useQStore from "@/stores/queue";
|
||||
import { focusElem } from "@/utils";
|
||||
|
||||
import TrackItem from "../shared/TrackItem.vue";
|
||||
import SongItem from "../shared/SongItem.vue";
|
||||
import QueueActions from "./Queue/QueueActions.vue";
|
||||
|
||||
const props = defineProps<{
|
||||
isOnQueuePage?: boolean;
|
||||
}>();
|
||||
|
||||
const TrackComponent = computed(() => {
|
||||
if (props.isOnQueuePage) {
|
||||
return SongItem;
|
||||
}
|
||||
|
||||
return TrackItem;
|
||||
});
|
||||
|
||||
const queue = useQStore();
|
||||
const mouseover = ref(false);
|
||||
|
||||
function setMouseOver(val: boolean) {
|
||||
mouseover.value = val;
|
||||
function playFromQueue(index: number) {
|
||||
queue.play(index);
|
||||
}
|
||||
|
||||
onUpdated(() => {
|
||||
@ -59,8 +51,8 @@ onUpdated(() => {
|
||||
overflow: auto;
|
||||
|
||||
.inner {
|
||||
scrollbar-color: grey transparent;
|
||||
margin: 1rem 0;
|
||||
// scrollbar-color: grey transparent;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
Loading…
x
Reference in New Issue
Block a user