<td v-for="(item, index) in array" :key="index" ref="referenceItem" @mouseenter="updateClass(index)" > updateClass(index: number) { const tdItem: any = this.$refs.referenceItem; referenceItem[index].className = 'new-class'; }