HTML
<div id="app">
<table>
<thead>
<tr>
<th>编号</th>
<th>科目</th>
<th>成绩</th>
<th>操作</th>
</tr>
</thead>
<tbody v-if="list.length > 0">
<tr v-for="(item,index) in list " :key="item.id">
<td>{
{index+1}}</td>
<td>{
{item.name}}</td>
<td :class="{red: item.agm < 60}">{
{item.agm}}</td>
<td><button @click="shchu(item.id)">删除</button></td>
</tr>
</tbody>
<tbody v-else="list.length < 0">
<tr>
<td colspan="5">
<p>没有数据</p>