实现表格中点击某个数据就会实现弹窗且是嵌套的?

 <el-table :data="tables.slice((currentPage - 1) * pageSize, currentPage * pageSize)" border stripe>
        <el-table-column type="index" label="#"></el-table-column>
        <el-table-column v-for="(item, index) in columnList" :key="index" :prop="item.prop" :label="item.label">
          <template slot-scope="scope">
            <el-button type="text" @click="showDialogTableVisibleEmbed(scope.row)">{{ scope.row.item.label
            }}</el-button>
          </template>
        </el-table-column>
      </el-table>

这么写表格数据直接就获取不到了

阅读 2.2k
1 个回答
<el-table :data="tables.slice((currentPage - 1) * pageSize, currentPage * pageSize)" border stripe>
  <el-table-column type="index" label="#"></el-table-column>
  <el-table-column v-for="(item, index) in columnList" :key="index" :prop="item.prop" :label="item.label">
    <template slot-scope="scope">
      <el-button type="text" @click="showDialogTableVisibleEmbed(scope.row)">{{ scope.row[item.prop] }}</el-button>
    </template>
  </el-table-column>
</el-table>

showDialogTableVisibleEmbed方法:


methods: {
  showDialogTableVisibleEmbed(row) {
   
    console.log(row);  // 行数据
  }
}
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题