[Vuejs]-Vue is printing my array with [] brackets, why?

4👍

Seems you need to run another loop

<div class="col-md-3 col-sm-12 h-100 d-table" v-for="opt in ansPurchaseonly">
 <div v-for="elem in opt">
     <span>{{ elem }}</span>
 </div>
</div>
👤brk

3👍

You can use another v-for, because your “opt” is still an array or alternatively you can use join the values like

<div class="row white-boxes justify-content-center">
  <div class="col-md-3 col-sm-12 h-100 d-table" 
       v-for="(opt, index) in ansPurchaseonly">
          <span>{{ opt.join(' ') }}</span>
  </div>
</div>

Leave a comment