Help needed with CSS issue.
I want to target the <tr>
element's class using Bootstrap classes like .success
or .danger
.
In my Vue.js project, the status name in my object does not align with the .success or .danger classes, but I still need to apply these classes based on the status name.
I have considered two solutions:
- Create a JS function that returns the appropriate class name based on the status name.
.<tr class={{myFunc(object.status)}}>
- Extend the Bootstrap class name in SASS.
.STATUS { @extend .success; }
As a beginner in frontend development, I used to create simple static HTML pages. Which solution should I go with? Are there any other options I can explore? I tried searching online but haven't found anything useful.
Any advice would be greatly appreciated.