el-table中给行加删除线 个人日常工作小记

css部分

.text-strikethrough {
    text-decoration: line-through;
}

dom部分

<el-table
	 :data="table"
     border
     :stripe="true"
     style="width: 100%"
     :height="infoTableHeight"
     resizable
     :cell-style="{padding:'0'}">
     <el-table-column
         v-for="column in tableColumn"
         :key="column.prop"
         :prop="column.prop"
         :label="column.label"
         :width="column.width"
         :fixed="column.fixed"
         :align="column.align">
         <template v-slot="scope">
             <span :class="shouldShowStrikethrough(scope.row) ? 'text-strikethrough' : ''">
               {{ scope.row[column.prop] }}
             </span>
         </template>
     </el-table-column>
     <template #empty>
         <div class="custom-empty-state" v-if="infoTableList">
             <img src="@/assets/imgs/data-null.png" alt="No Data">
             <p>暂无数据</p>
         </div>
     </template>
 </el-table>

//逻辑部分

methods:{
        shouldShowStrikethrough(row) {
            return row.biz_status.includes('取消') || row.goods_status.includes('取消')
        },
}

效果如下:
在这里插入图片描述

个人工作小记,欢迎沟通交流!

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值