1、动态添加ref:
<li v-for="(item, index) in dataList" :ref="`program${index}`" @click="checkLog(index)"></li>
2、通过ref设置li的背景颜色
checkLog(index){
for(let i = 0; i < this.dataList.length; i++){
this.$refs[`program${i}`][0].style.background='#282d3b'
}
this.$refs[`program${index}`][0].style.background='#333a4c'
},