mirror of
https://github.com/tcsenpai/swingmusic.git
synced 2025-06-14 23:17:19 +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%;
|
height: 100%;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
display: grid;
|
display: grid;
|
||||||
|
gap: $small;
|
||||||
grid-template-rows: max-content 1fr;
|
grid-template-rows: max-content 1fr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,12 @@
|
|||||||
<template>
|
<template>
|
||||||
<QueueActions />
|
<QueueActions />
|
||||||
<div class="scrollable-r">
|
<div
|
||||||
|
class="scrollable-r"
|
||||||
|
@mouseover="mouseover = true"
|
||||||
|
@mouseout="mouseover = false"
|
||||||
|
>
|
||||||
<div class="inner">
|
<div class="inner">
|
||||||
<TrackComponent
|
<TrackItem
|
||||||
v-for="(t, index) in queue.tracklist"
|
v-for="(t, index) in queue.tracklist"
|
||||||
:key="index"
|
:key="index"
|
||||||
:track="t"
|
:track="t"
|
||||||
@ -10,38 +14,26 @@
|
|||||||
:isPlaying="queue.playing"
|
:isPlaying="queue.playing"
|
||||||
:isHighlighted="false"
|
:isHighlighted="false"
|
||||||
:isCurrent="index === queue.currentindex"
|
:isCurrent="index === queue.currentindex"
|
||||||
|
@PlayThis="playFromQueue(index)"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed, onUpdated, ref } from "vue";
|
import { onUpdated, ref } from "vue";
|
||||||
|
|
||||||
import useQStore from "@/stores/queue";
|
import useQStore from "@/stores/queue";
|
||||||
import { focusElem } from "@/utils";
|
import { focusElem } from "@/utils";
|
||||||
|
|
||||||
import TrackItem from "../shared/TrackItem.vue";
|
import TrackItem from "../shared/TrackItem.vue";
|
||||||
import SongItem from "../shared/SongItem.vue";
|
|
||||||
import QueueActions from "./Queue/QueueActions.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 queue = useQStore();
|
||||||
const mouseover = ref(false);
|
const mouseover = ref(false);
|
||||||
|
|
||||||
function setMouseOver(val: boolean) {
|
function playFromQueue(index: number) {
|
||||||
mouseover.value = val;
|
queue.play(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
onUpdated(() => {
|
onUpdated(() => {
|
||||||
@ -59,8 +51,8 @@ onUpdated(() => {
|
|||||||
overflow: auto;
|
overflow: auto;
|
||||||
|
|
||||||
.inner {
|
.inner {
|
||||||
scrollbar-color: grey transparent;
|
// scrollbar-color: grey transparent;
|
||||||
margin: 1rem 0;
|
margin-bottom: 1rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user