src/scripts/util.js
@@ -249,6 +249,22 @@ } } //拆分二维数组 const chunkArr = (arr, size = 1)=>{ if (arr.length == 0) return; const tempContainer = []; let innerArr = []; arr.forEach(item => { if (innerArr.length == 0) { tempContainer.push(innerArr); } innerArr.push(item); if (innerArr.length == size) { innerArr = []; } }); return tempContainer; } export { thisRouterObjFn, json2url, @@ -264,5 +280,6 @@ guid, cloneDeep, getYearWeek, getContainerRect getContainerRect, chunkArr }