elementui 如何在点击按钮获取对应行的数据

img


这个属性为什么用不了啊,怎么点击一个按钮获得表格当前行的数据我好传到后台去

这样,使用scope.row可以获取当前行数据

 <template slot-scope="scope">
        <el-button @click="handleClick(scope.row)" type="text" size="small">查看</el-button>
        <el-button type="text" size="small">编辑</el-button>
      </template>

给按钮绑定了点击事件么


<template slot-scope="scope">
  {{scope.$index}}  这个就是索引

会不会因为你那个prop为空啊,写操作列的时候可以去掉试试看