优化代码逻辑,修复潜在播放问题
This commit is contained in:
@@ -21,7 +21,7 @@ export default (name: string) => {
|
||||
}
|
||||
|
||||
const handle_key_up = () => {
|
||||
if (keyDown.value) keyDown.value = false
|
||||
keyDown.value &&= false
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
|
||||
@@ -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(() => {
|
||||
|
||||
Reference in New Issue
Block a user