新增播放室页面,支持歌曲播放进度条拖拽功能。在播放队列存储中添加当前播放时间和总时长状态。更新播放器组件以支持跳转到播放室页面,并集成GSAP动画库用于实现进度条拖拽效果。
14 lines
493 B
TypeScript
14 lines
493 B
TypeScript
import { defineStore } from "pinia"
|
|
import { ref } from "vue"
|
|
|
|
export const usePlayQueueStore = defineStore('queue', () =>{
|
|
const list = ref<QueueItem[]>([])
|
|
const currentIndex = ref<number>(0)
|
|
const isPlaying = ref<boolean>(false)
|
|
const queueReplaceLock = ref<boolean>(false)
|
|
const isBuffering = ref<boolean>(false)
|
|
const currentTime = ref<number>(0)
|
|
const duration = ref<number>(0)
|
|
|
|
return { list, currentIndex, isPlaying, queueReplaceLock, isBuffering, currentTime, duration }
|
|
}) |