Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

268
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda