I have to add red background Colour for false, and green background for true based on the result column in a table, I am using elementUI + paginations of data-tables + vuejs. I am try to add in the column declarations by using style binding on result column thanks in advance
My template code
<template slot="header" slot-scope="table" :style = "customRowBackground(table.row)">
<template slot-scope="table">{{ table.row.launch_success }}</template>
</el-table-column>
my customRowBackgrond() function
customRowBackgrond({row}){
if (row.launch_success == true) {
return {'backgrondColor': 'rgb(252, 230, 190)'};
}
else if (row.launch_success == false) {
return { backgrondColor: 'rgb(252, 230, 190)'};
}
else {
return {backgrondColor: 'rgb(252, 230, 190)'};
}
},
I need to get the true value to green and false to red to my whole table.... Thanks in advance.