背景:

  这里是通过点击“修改”按钮后才拿到当前行的数据,不是点击当前行任意位置拿到数据,所以不能用 @row-click 方法

  改用点击的时候直接拿到这个表里面的这一条数据

elementUI拿到当前表格行的数据的另一种写法

 

1.绑定事件

elementUI拿到当前表格行的数据的另一种写法

 

<template slot-scope="scope">
     <el-button size="mini" type="warning" @click="RightTbaleBtnClick(RightTypeData[scope.$index])">修改</el-button>
</template>

 

2.拿到数据

elementUI拿到当前表格行的数据的另一种写法

 

RightTbaleBtnClick(item){

  console.log("修改事件")
  console.log(item)
},

 

 elementUI拿到当前表格行的数据的另一种写法

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-03-02
  • 2021-08-27
  • 2022-12-23
  • 2021-09-25
  • 2021-08-29
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-01
  • 2022-12-23
  • 2022-12-23
  • 2021-12-03
相关资源
相似解决方案