新增数据对象数据:
this.$api.post('/jx/videodanmu', { vid: 481 }, (res) => {
if (res.status) {
this.barrageList = res.data
console.log(this.barrageList, 'res.data')
this.barrageList.forEach((item) => {
item.key = 'atb8ctt81egh8hf45u7n2g'
item.createdAt = '2019-01-13T13:34:47.126Z'
item.time = Math.floor(Math.random() * 1000)
item.text = item.comment
item.fontFamily = 'SimSun'
item.fontSize = 32
item.color = 'yellow'
})
this.barrageList.forEach(t => delete t.comment)
} else {
this.$notify.warning({
title: '提示',
message: res.msg
})
}
})
this.barrageList.forEach(t => delete t.comment)
图片.png
网友评论