table中是否显示、显示状态变更

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>
 
暂无评论

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
下一篇