|
|
@@ -419,6 +419,7 @@ export default {
|
|
|
},
|
|
|
// 生命周期 - 挂载完成(可以访问DOM元素)
|
|
|
mounted() {
|
|
|
+ this.handlePlay();
|
|
|
this.audio.addEventListener('timeupdate', () => {
|
|
|
this.currentTime = this.audio.currentTime;
|
|
|
const currentTime = this.audio.currentTime;
|
|
|
@@ -481,6 +482,7 @@ export default {
|
|
|
this.isPlay = false;
|
|
|
this.currentTime = 0;
|
|
|
this.sentenceActive -= 1;
|
|
|
+ this.handlePlay();
|
|
|
} else {
|
|
|
this.$message.warning('已经是第一句');
|
|
|
}
|
|
|
@@ -489,6 +491,7 @@ export default {
|
|
|
this.isPlay = false;
|
|
|
this.currentTime = 0;
|
|
|
this.sentenceActive += 1;
|
|
|
+ this.handlePlay();
|
|
|
} else {
|
|
|
this.$message.warning('已经是最后一句');
|
|
|
}
|
|
|
@@ -518,6 +521,9 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
},
|
|
|
+ beforeDestroy() {
|
|
|
+ this.audio.pause();
|
|
|
+ },
|
|
|
};
|
|
|
</script>
|
|
|
|