element中table单元格点击事件获取id


1、template部分

<template>
  <el-table :data="tableData" stripe border style="width: 100%">
    <el-table-column prop="checkUnit" label="医院名称"></el-table-column>
    <el-table-column prop="checkName" label="检查名称"></el-table-column>
    <el-table-column label="查看详情">
       <template slot-scope="scope">
          <el-button size="mini" @click="infoList_detial(scope.row.id)">查看详情</el-button>
       </template>
    </el-table-column>
  </el-table>
</template>

 

2、js部分

export default {
  name: 'ExperimentalExamination',
  data () {
    return {
      tableData: [{
        id:1
        checkUnit:医院1,
        checkName:名称1
      },{
        id:2
        checkUnit:医院2,
        checkName:名称2
      },{
        id:3
        checkUnit:医院3,
        checkName:名称3
      }]
    }
  },
  methods:{
    infoList_detial(id){
        console.log(id);
    }
}

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM