1.按钮是否显示

<el-table-column label="Operation" width="90" align="center" fixed="right">
  <template slot-scope="scope">
      <el-button type="text" size="small" 
          v-if="scope.row.user!='Online Deposit'" @click="detail()">
          Detail</el-button>
  </template>
</el-table-column>

按钮中v-if判断是否显示

2.三目运算

<el-table-column prop="status" label="Status" width="150" align="center">
   <template slot-scope="scope">
       {{scope.row.status == 1 ? 'Succeeded' : scope.row.status == 2 ? 
        'Approvaling' : scope.row.status == 3 ? 'Cancelled': ''}}
   </template>
</el-table-column>

3.根据状态不同,显示状态不同

当状态为成功,重试按钮置灰
效果:

作者:指尖架构141319
链接:https://www.jianshu.com/p/6ed7c6d100a7
来源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

 

 

<el-table-column label="操作" min-width="90" align="center" fixed="right">
        <template slot-scope="scope">
          <el-button type="text" v-if="scope.row.recordStatus==1" disabled="true" size="small" @click="retry(scope.row)">重试</el-button>
          <el-button type="text" v-if="scope.row.recordStatus!=1" size="small" >重试</el-button>
          <el-button type="text" size="small" @click="detail(scope.row)">详情</el-button>
        </template>
      </el-table-column>