Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

260
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda