<table class="mytable mt10"> <template v-for="(item,index) in device_fault"> <tr v-if="index == 0"> <td>设备名称</td> <td>次数(次)</td> <td>占比(%)</td> </tr> <tr> <td v-text="item.name"></td> <td v-text="item.num"></td> <td><span class="proportion" v-text="item.num/runData.faultCount*100"></span>%</td> </tr> <tr class="fb" v-if="index == device_fault.length-1"> <td>总计</td> <td v-text="runData.faultCount"></td> <td>100%</td> </tr> </template> </table>