[Vuejs]-Vue.js How to condition render tr in table

0👍

you can slice the array and use a nested loop in Vue template.

https://jsfiddle.net/9Lf7zo4g/2/

 computed: {
   sliced: function() {
     const sliced = []
     const chunk = 3
     for(let i = 0; i < data.length; i = i + chunk) {
       sliced.push(this.data.slice(i, i + chunk))
     }
     return sliced
  }
}

Leave a comment