Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

258
Views
Vue Buefy table with multiple row statuses

Buefy tables has a setting where you can choose what rows are highlighted by a specific colour depending on a variable in the row.

            :row-class="(row, index) => row.variable === x && 'is-info'">

and adding style for the specific row-class:

<style>
    .is-info' {
      background: #FF8C4B;
    }

This works, and i can highlight all rows with x as their variables. But consider if I have a table with multiple variables X, Y ,Z. And i want all the ones with variable value of X to be highlighted blue and the ones with Y to be red. Is this possible? I cant seem to find any examples anywhere.

This is my current data section of the vue page:

export default {
  name: "Demo",
  data: () => {
    data: () => {
return {
  loading: null,
  alphabets: [],
  className:{
    'x': '.bg-danger',
    'y': '.bg-success'
  },
};
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

You can define class map in data object as follows:

:row-class="(row, index) => className[row.variable]">

data: ()=> ({className: {
x:'info',
y:'primary'
z:'warning'

}})
about 4 years ago · Juan Pablo Isaza Report

0

This is how it can be done:

:row-class="(row, index) => row.alphabet === 'x' && 'is-x' || row.alphabet === 'y' && 'is-y' || row.alphabet === 'z' && 'is-z'"

and then style it

<style>
  .is-x{
    background: #f15462;
  }
  .is-y{
    background: #f5bb1a;
  }
  .is-z{
    background: #3bdc5e;
  }
}
</style>
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!