<span v-else-if="msg.type==='audio'" class="msg-text msg-audio" id="msg-audio" @click="playAudio(msg.audioSrc)"> <span v-show="page_showAudio">{{msg.showText}}</span> <img class="page_voice" v-show="page_voiceShow" src="http://college.m-fyd.com/assets/yunxin/res/im/voiceSpeaker.gif"/> </span>
playAudio (src) { console.log(src) if (!this.currentAudio) { this.currentAudio = new Audio() this.currentAudio.onended = () => { this.page_voiceShow = false } } this.currentAudio.src = src this.currentAudio.play() this.page_voiceShow = true }