Jelajahi Sumber

fix:播放问题

liushengqiang 2 tahun lalu
induk
melakukan
a9712d02fd
1 mengubah file dengan 6 tambahan dan 4 penghapusan
  1. 6 4
      src/views/xiaoku-music/component/play-item/index.tsx

+ 6 - 4
src/views/xiaoku-music/component/play-item/index.tsx

@@ -51,8 +51,8 @@ export default defineComponent({
         audioData.isFirst = false;
         return;
       }
-      if (props.playState === 'play'){
-          audioRef.value.play();
+      if (props.playState === 'play') {
+        audioRef.value.play();
       }
     };
     /** 改变时间 */
@@ -62,7 +62,9 @@ export default defineComponent({
       clearTimeout(timer);
       timer = setTimeout(() => {
         audioRef.value.currentTime = val;
-        audioRef.value.play();
+        if (props.playState === 'play') {
+          audioRef.value.play();
+        }
         timer = null;
       }, 300);
     };
@@ -114,7 +116,7 @@ export default defineComponent({
           </div>
           <div class={styles.title}>
             <div class={styles.titleName}>
-                <TheNoticeBar text={props.item.musicSheetName} />
+              <TheNoticeBar text={props.item.musicSheetName} />
             </div>
             <div class={styles.titleDes}>{props.item.composer}</div>
           </div>