<div id="audioTest">
<audio :src="music" preload controls hidden id="music"></audio>
</div>
playMusic() {
var audio = document.getElementById('music')
if (audio !== null) {
if (this.playFlag) {
audio.pause()
this.playFlag = false
} else {
audio.currentTime = 0
audio.play()
this.playFlag = true
}
}
},
网友评论