mirror of
https://github.com/qier222/YesPlayMusic.git
synced 2026-04-05 10:20:31 +08:00
fix(Player): 修复拖动控件时误触父元素点击事件的问题 (#2444)
Co-authored-by: sc <sc@0x1247c14@gmail.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="player" @click="toggleLyrics">
|
||||
<div class="player" @click="handleClick" @mousedown="handleMouseDown">
|
||||
<div
|
||||
class="progress-bar"
|
||||
:class="{
|
||||
@@ -195,6 +195,11 @@ export default {
|
||||
ButtonIcon,
|
||||
VueSlider,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
mouseDownTarget: null,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapState(['player', 'settings', 'data']),
|
||||
currentTrack() {
|
||||
@@ -227,6 +232,14 @@ export default {
|
||||
methods: {
|
||||
...mapMutations(['toggleLyrics']),
|
||||
...mapActions(['showToast', 'likeATrack']),
|
||||
handleClick(event) {
|
||||
if (event.target == this.mouseDownTarget) {
|
||||
this.toggleLyrics();
|
||||
}
|
||||
},
|
||||
handleMouseDown(event) {
|
||||
this.mouseDownTarget = event.target;
|
||||
},
|
||||
playPrevTrack() {
|
||||
this.player.playPrevTrack();
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user