【发布时间】:2021-01-29 04:24:39
【问题描述】:
如何用视频文件更新“src”的值?
在movie.vue中
<div class="row">
<video width="640" controls autoplay>
<source
id="youtube"
ref="youtube"
src="https://static.videezy.com/system/resources/previews/000/019/697/original/pointing-grey.mp4"
type="video/mp4"
/>
Your browser does not support the video tag.
</video>
<button class="btn btn-primary" @click="Change">
Skip Ads
</button>
</div>
</div>
在我的脚本中
methods: {
Change() {
console.log("Skip Ads");
this.$refs.youtube.src =
"https://static.videezy.com/system/resources/previews/000/019/697/original/pointing-grey.mp4";
console.log(this.$refs.youtube.src);
}
},
【问题讨论】: