I want to display the values in the day object such as: Sunday, Monday, etc.
For now, here my code:
<div class="col-md-3 col-sm-6" v-for="item in result" v-bind:key="item.schedule_id"> {{ item.day }} </div> My result:
[ "Monday", "Wednesday" ] You can do another loop as
<div class="col-md-3 col-sm-6" v-for="item in result" v-bind:key="item.schedule_id"> <div v-for="(day , index) in item.day" :key="index"> {{day}} </div> </div> If you want just return the days use the flatMap function :
<div class="col-md-3 col-sm-6" v-for="day in result.flatMap(item=>item.day)" v-bind:key="day"> {{ day }} </div> if you want to separate them by comma use this :
<div class="col-md-3 col-sm-6" > {{ result.flatMap(item=>item.day).join(',') }} </div> or between arrays:
<div class="col-md-3 col-sm-6" > {{ result.map(item=>item.day).join(',') }} </div>