<template slot-scope="scope">

通过后端返回的具体值,前端可以映射想要的值

如:status状态值为0就是代办,为1就是处置,为2就是完成

    <el-table-column label="工单状态" prop="status">
          <template slot-scope="scope">
            <span style="margin-left: 10px">{{
              scope.row.status == "0"
                ? "待办"
                : scope.row.status == "1"
                ? "处置中"
                : "完成"
            }}</span>
          </template>
    </el-table-column>

 

 

此外这里每行还有编辑,删除等功能,事件处理函数中的参数,scope.$index就是该行的下标,scope.row就是该行的数据所有消息对象

 

posted @ 2023-04-29 22:05  Mr_sven  阅读(108)  评论(0编辑  收藏  举报