<table class="table table-striped table-sm table-hover" id="list">
    <tr class="text-center">
        <th>序号</th>
        <th>编号</th>
        <th>名称</th>
        <th>操作</th>
    </tr>
    <tr class="text-center" v-for="(material,i) in materials" @click="selectTr===i+1?selectTr=0:selectTr=i+1" :class="selectTr===i+1?'focusing' : ''">
        <td>@{{ i+1 }}</td>
        <td>@{{ material.code }}</td>
        <td>@{{ material.name }}</td>
        <td>
            @can('耗材类型-编辑')
                <button class="btn btn-sm btn-outline-primary" @click="edit(material,i)">编辑</button>
            @endcan
            @can('耗材类型-删除')
                <button class="btn btn-sm btn-outline-danger" @click="destroy(material.id,i)">删除</button>
            @endcan
        </td>
    </tr>
</table>
{{ $materials->links() }}
