element table中点击获取当行数据

479 阅读1分钟

element中的table中放置button写在组件中如: 在button的点击事件中可以找到scope参数(index,row数据,column数据))

<el-table-column
  align="right">
  <template slot-scope="scope">
    <el-button
      size="mini"
      @click="handleEdit(scope.$index, scope.row)">Edit</el-button>
    <el-button
      size="mini"
      type="danger"
      @click="handleDelete(scope.$index, scope.row)">Delete</el-button>
  </template>
</el-table-column>