对于重组组合分类数据方法
categoryArr () {
const max = 8
const arr = []
const { categorys } = this //数据源
let smallArr = [] // 新组成的数据
categorys.forEach((item,index) => {
if(smallArr.length === 0) {
arr.push(smallArr)
}
smallArr.push(item)
if(smallArr.length === max) {
smallArr = []
}
})
return arr
}
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。