0👍
You can have custom colored rows without changing the theme colors. Since you are giving the class name based on row, you can write CSS for the same.
Example : Lets say you have 3 types of row colors (row-danger, row-warning, row-primary)
methods: {
colorRowByCode(item, type){
if (!item || type !== 'row') return
if(item.level === 'Critical') return 'row-danger'
if(item.level === 'Warning') return 'row-warning'
if(item.level === 'Error') return 'row-primary'
}
}
Now in CSS you can add,
<style lang="css">
.row-primary{
background: #FFDEB9;
}
.row-danger{
background: #FF0000;
}
.row-warning{
background: #FF0101;
}
</style>
So basically you will be adding classes to your HTML using your method colorRowByCode
and those classes will define the color for row as shown in CSS
- [Vuejs]-Add items to a shopping cart with Vue?
- [Vuejs]-I want to disable mouse scroll trigger in fullpage.js only
Source:stackexchange.com