How to modify the data rendered by v-for and then bind the style?

<tr v-for="item in tableData">
  <td :class="same">{{item.td}}</td>
</tr>

computed:{
  same(){
    let arr = ???.push("c");
    return{
      red: arr == ["a","c"]
    }
  }
}

here? It should be the data of item.td. How to write it? It"s not very scientific to use the native JS method to traverse the tableData.


it should be possible to use the method,

 <tr v-for="(item, idx) in tableData">
  <td :class="same(idx)">{{item.td}}</td>
</tr>

methods:{
  same(idx){
    let arr =this.tableData[idx].push('c');
    return{
      red: arr == ['a','c']
    }
  }
}

does not traverse, how do you know what is in it


do not quite understand what you mean, please describe the problem in detail

Menu