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

151
Vistas
Vuejs b-table array template

I want to create a b-table template can understand data type and if it is array then it shows array keys one under the other. For example:

data.item.value may be :

  • string
  • array
  • json
<b-table :items="mydata"> 

<template #cell(name)="data"> 

  <b-list-group-item>
  {{data.item.value}}
  </b-list-group-item>

</template>
</b-table>

if data.item.value is array should open new b-list-group-item automatically:

first b-list-group-item :  data.item.value[0].name
second b-list-group-item :  data.item.value[1].name

How can I handle this?

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

You would use v-for on the array inside your template. Then you can use v-if to special case type inside the group-item.

<b-table :items="mydata"> 
  <template #cell="data"> 
    <b-list-group-item v-for='value of data.item.value'>
      {{value.name}}
    </b-list-group-item> 
  </template>
</b-table>
over 4 years ago · Santiago Trujillo 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