Element-ui 里面ID如何获取

如果你遇到了表格中按钮需要id的,就往下看吧

<el-table-column
  label="操作">

  <template slot-scope="scope">
    <el-button type="primary" @click="Update(scope.row.id)" >修改</el-button>
    <el-button type="danger" @click="Del(scope.row.id)">删除</el-button>
  </template>
</el-table-column>

scope.row.id 获取本条数据的ID

scope.row 获取本条数据

 

posted @ 2020-11-21 21:45  这是春天吧  阅读(4045)  评论(0)    收藏  举报