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

148
Views
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 answers
Answer question

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 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!