<template>部分
<tr v-for="(item,index) in message" :key="index" @click="showDeviceByDiv($event,index)" :class="{active: activeName == index}" ><td >{{item.dev}}</td></tr>
js部分
data(){
return{ activeName: '',}
}
methods:{
showDeviceByDiv(event,index){
const _this = this
_this.activeName = index
}
}
效果图