太原做网站的通讯公司有哪些,迁安做网站,互动平台是什么,成都设计公司排行1.这两个属性的使用#xff0c;row-class-name用在el-table标签上#xff0c;class-name用在el-table-column标签上。两个属性即可绑定类名也可绑定函数
!-- 这里是绑定函数#xff0c;也可以绑定类名 --
el-table :datatableData selection-chang…1.这两个属性的使用row-class-name用在el-table标签上class-name用在el-table-column标签上。两个属性即可绑定类名也可绑定函数
!-- 这里是绑定函数也可以绑定类名 --
el-table :datatableData selection-changehandleSelect :row-class-nameshower border height400px scrollbar-always-onel-table-column width60 typeselection /el-table-column width150 propname label订单号 /el-table-column width120 propestimateTotal label跟单员 /el-table-column width5 /el-table-column label操作 width150template #default{ row }el-button typeprimary text clickconfirmData(row, 1) v-iftrue确认应收数据/el-buttonel-button typeprimary text clickRemoveconfirm(row, 1) v-else撤销确认/el-button/template/el-table-column!-- 这里是绑定类名也可以绑定函数 --el-table-column width180 propname label客户名称 class-nameunconfirmeds/el-table-column width120 propmeetName label核销状态 /
/el-table
2.绑定函数时就可以通过条件来决定哪行需要添加样式
function shower({row}){console.log(row);if(row.name阿尼亚){return unconfirmeds}else{return }
}
3.样式无效处理
样式没有效果的原因在于添加的样式不是全局样式所以只需要将scoped去除或者自己定义一个全局样式
style
.unconfirmeds{background-color: rgba(255, 0, 0, 0.075) !important;color:red;font-weight: 700;
}
/style
4.最终效果