[Vuejs]-Do v-for only when there are data

0๐Ÿ‘

 <div v-if="titles" >
      <div :key="chart.id" v-for="chart in titles.titles"> 
        <DataInfo :chart="chart" /> 
      </div>  
 </div>

and declare a data titles set to null, and when you get your ajax response assign the resulting datas to your titles variable

data(){
  return { 
    titles: null
  }
}

Leave a comment