先上代码,问题如标题,根据p的内容不同来为其添加不同颜色的背景颜色,自己弄了好久,不知道怎么搞了~
<table cellSpacing=0 cellPadding=0 id="right_table2" class="table table-bordered"> <tr v-for="item in data4" > <td><p>{{item.gonghangId}}</p></td> <td><p>{{item.jianhangId}}</p></td> <td><p>{{item.nonghangId}}</p></td> <td><p>{{item.zhonghangId}}</p></td> <td><p>{{item.zhaoshangId}}</p></td> <td><p>{{item.jiaohangId}}</p></td> <td><p>{{item.pufaId}}</p></td> <td><p>{{item.guangdaId2}}</p></td> <td><p>{{item.guangdaId}}</p></td> </tr> </table>
data4: [ {regions: '云南', gonghangId: '测试', jianhangId: '不准入', nonghangId: '协议流转', zhonghangId: '谈费率', zhaoshangId: '测试', shuangyouId:''}, {regions: '江苏', gonghangId: '测试', jianhangId: '测试', nonghangId: '协议流转', zhonghangId: '不合作', zhaoshangId: '测试', shuangyouId:'谈费率'}, ]
眼眸繁星