如果你遇到了表格中按鈕需要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 獲取本條數據