优化代码逻辑,修复潜在播放问题

This commit is contained in:
lyswhut
2023-01-14 16:03:56 +08:00
parent d3c8f16aed
commit 850a429243
35 changed files with 85 additions and 342 deletions
@@ -21,7 +21,7 @@ export default (name: string) => {
}
const handle_key_up = () => {
if (keyDown.value) keyDown.value = false
keyDown.value &&= false
}
onMounted(() => {
+3 -3
View File
@@ -128,7 +128,7 @@ export default ({ isPlay, lyric, playProgress, isShowLyricProgressSetting, offse
}
const handleMove = (y) => {
if (isMsDown.value) {
if (!isStopScroll.value) isStopScroll.value = true
isStopScroll.value ||= true
if (cancelScrollFn) {
cancelScrollFn()
cancelScrollFn = null
@@ -150,7 +150,7 @@ export default ({ isPlay, lyric, playProgress, isShowLyricProgressSetting, offse
const handleWheel = (event) => {
console.log(event.deltaY)
if (!isStopScroll.value) isStopScroll.value = true
isStopScroll.value ||= true
if (cancelScrollFn) {
cancelScrollFn()
cancelScrollFn = null
@@ -197,7 +197,7 @@ export default ({ isPlay, lyric, playProgress, isShowLyricProgressSetting, offse
const scrollLine = (line, oldLine) => {
if (line < 0) return
if (line == 0 && isSetedLines) return isSetedLines = false
if (isSetedLines) isSetedLines = false
isSetedLines &&= false
if (oldLine == null || line - oldLine != 1) return handleScrollLrc()
delayScrollTimeout = setTimeout(() => {