audio
Showing
2 changed files
with
12 additions
and
1 deletions
... | @@ -89,7 +89,15 @@ | ... | @@ -89,7 +89,15 @@ |
89 | Copyright©zhangyongfeng5350@gmail.com | 89 | Copyright©zhangyongfeng5350@gmail.com |
90 | </span> | 90 | </span> |
91 | 91 | ||
92 | <audio id="audiobg" :src="audioSrc" preload="auto" controls autoplay loop> | 92 | <audio |
93 | id="audiobg" | ||
94 | preload="auto" | ||
95 | controls | ||
96 | autoplay | ||
97 | loop | ||
98 | @play="playHandler" | ||
99 | > | ||
100 | <source :src="audioSrc" /> | ||
93 | 你的浏览器不支持audio标签 | 101 | 你的浏览器不支持audio标签 |
94 | </audio> | 102 | </audio> |
95 | </div> | 103 | </div> |
... | @@ -235,6 +243,9 @@ export default { | ... | @@ -235,6 +243,9 @@ export default { |
235 | }, 1000); | 243 | }, 1000); |
236 | }, | 244 | }, |
237 | methods: { | 245 | methods: { |
246 | playHandler() { | ||
247 | this.audioPlaying = true; | ||
248 | }, | ||
238 | playAudio(type) { | 249 | playAudio(type) { |
239 | if (type) { | 250 | if (type) { |
240 | this.$el.querySelector('#audiobg').play(); | 251 | this.$el.querySelector('#audiobg').play(); | ... | ... |
No preview for this file type
-
Please register or sign in to post a comment