From 92dfbc3411e71c40b282d2c0b1ed6aaee3720227 Mon Sep 17 00:00:00 2001 From: weipengfei <2187978347@qq.com> Date: Thu, 12 Oct 2023 19:24:02 +0800 Subject: [PATCH] s --- src/views/chat/components/Message/index.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/views/chat/components/Message/index.vue b/src/views/chat/components/Message/index.vue index 48948c3..431e295 100644 --- a/src/views/chat/components/Message/index.vue +++ b/src/views/chat/components/Message/index.vue @@ -129,7 +129,7 @@ async function radioPlay() { onAudioEnd(playIndex) }) audioElements.push(a) - if(playing==false) playAudio() + if(playIndex==0||playing==false) playAudio(playIndex) } // for (let i = 0; i < props.mp3.length; i++) { @@ -154,9 +154,9 @@ const onAudioEnd = (index: any) => { // 创建音频对象的数组 const audioElements = reactive([]) // 播放音频 -const playAudio = () => { +const playAudio = (playIndex:any) => { // for (let i = 0; i < audioElements.length; i++) - audioElements[0].play() + audioElements[playIndex].play() } // 暂停音频