Diablo_D 2023-08-18 13:57 采纳率: 100%
浏览 66
已结题

el-table-column属性prop获取的参数值,怎么在其他方法中调用

<el-table :data="TableData">
        <el-table-column
          prop="ID"
          type="index"
          key="index-column"
          :width="50"
          label="序号"
          align="center"
        ></el-table-column>
        <el-table-column label="任务名称" width="260px" prop="taskName">
        </el-table-column>
        <el-table-column label="任务UUID" width="280px" prop="taskUuid">
        </el-table-column>
        <el-table-column label="操作">
          <template slot-scope="scope">
            <el-button
              type="primary"
              size="mini"
              @click="onStart">启动</el-button>
          </template>
        </el-table-column>
      </el-table>

通过el-table-column属性prop获取的taskUuid的值

onStart({ index, row}) {
      const that = this;
      api.rpa
        .startTask(scope.row.taskUuid)
        .then(({ success, msg }) => {
          that.$message({
            message: msg || "提交成功",
            type: success ? "success" : "error"
          });
        })
        .catch(res => {
        });
    }

怎么放到onStart方法中用

  • 写回答

3条回答 默认 最新

  • 发狂精灵 2023-08-18 14:18
    关注
     <el-button
                  type="primary"
                  size="mini"
                  @click="onStart(scope.row)">启动</el-button>
    
    onStart(row) {
         row.taskUuid
        }
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

问题事件

  • 系统已结题 8月27日
  • 已采纳回答 8月19日
  • 创建了问题 8月18日