channelbg 用于切换bgselect的内容
重点就是 替换了source的src以后,要进行load操作和play操作,否则不生效
(我这里直接改成了0,作为测试 -- this.bg.video[0])
methods: { channelbg: function () { var index = 0; setInterval(() => { this.bgselect = this.bg.video[0] this.$refs.videobox.load(); this.$refs.videobox.play(); console.log(this.bgselect) },2000) }, },
然后直接调用即可:
mounted: function() { this.channelbg() }