slot-scope

<el-table>
  <el-table-column label="测试" >
     <template slot-scope="scope" prop="testType">
      //prop可以接收接口的参数,例如这个testType是后端传给你的用来选择状态的参数,就可以这样用
        <span v-if="scope.row.testType==0" >会议进行中</span>
        <span v-if="scope.row.testType==1" >会议准备中</span>
        <span v-if="scope.row.testType==2" >会议结束</span>
     </template>
  </el-table-column>
</el-table>
<el-table-column label="弹出框">
  <template slot-scope="scope">
     <el-button @click="testBtn(scope.row)">查看弹框</el-button>
这个scope.row是当前表格一行的所有数据,例如 scope.row.id就可以拿到后端传过来的id,然后把这个id传给后端,用来操作这一行(例如各种点击事件)
  </template>
</el-table-column>

export default{
  data(){},
methods:{
  testBtn(item){
  let val = {
    id= item.id
  这个id,就是后端所需要你传的参数,从上面的点击事件中传过来
  }
  }
}
原文地址:https://www.cnblogs.com/ll15888/p/11305256.html