Open wlinglinux opened 5 years ago
mediaEvents.forEach(event => { this.audio.addEventListener(event, e => this.$emit(event, e)) }) 这个代码看着是抛出了事件,但是监听不到,且我就想拿到当前音频的播放状态,用来改变按钮的样式,但是这样写也不对 onClick(){ this.$nextTick(function(){ this.isPlaying = this.$refs.player.isPlaying console.log(this.isPlaying) }) }
mediaEvents.forEach(event => { this.audio.addEventListener(event, e => this.$emit(event, e)) }) 这个代码看着是抛出了事件,但是监听不到,且我就想拿到当前音频的播放状态,用来改变按钮的样式,但是这样写也不对 onClick(){ this.$nextTick(function(){ this.isPlaying = this.$refs.player.isPlaying console.log(this.isPlaying) }) }