Browse Source

更新音频的播放次数

Michael Wang 6 năm trước cách đây
mục cha
commit
e92ec9b2dd
1 tập tin đã thay đổi với 9 bổ sung3 xóa
  1. 9 3
      src/features/OnlineExam/Examing/QuestionBody.vue

+ 9 - 3
src/features/OnlineExam/Examing/QuestionBody.vue

@@ -144,12 +144,16 @@ export default {
       }
     },
     audioEnded(name) {
-      this.audioInPlay = new Set(this.audioInPlay).delete(name);
+      const s = new Set([...this.audioInPlay]);
+      s.delete(name);
+      this.audioInPlay = s;
     },
     played(index, $event) {
       const name = $event.target.attributes.name.value;
       if (!this.examQuestion.limitedPlayTimes) {
-        this.audioInPlay = new Set(this.audioInPlay).add(name);
+        const s = new Set([...this.audioInPlay]);
+        s.add(name);
+        this.audioInPlay = s;
         // 如果没有设置音频播放次数
         return false;
       }
@@ -164,7 +168,9 @@ export default {
         $event.target.pause();
         return;
       }
-      this.audioInPlay = new Set(this.audioInPlay).add(name);
+      const s = new Set([...this.audioInPlay]);
+      s.add(name);
+      this.audioInPlay = s;
 
       // var audio = new Audio($event.target.src);
       // audio.play();