樣式
padding: 20upx;
background-color: #f6f6f6;
column-count: 2;
/*分爲兩列 用於瀑布流*/
column-gap: 20upx;
數據處理
setDataList(newVal) {
const newList = [].concat(...Array.from(newVal.reduce((total, cur, index) => { //瀑布流處理
total[index % 2].push(cur)
return total
}, {
0: [],
1: [],
length: 2
})))
this.setData({
newList: newList
})
},