如题,将[{},{},{}] 转换为[[{},{},{}],[{},{},{}]]
let list = ref([
{
number: "001",
},
{
number: "002",
},
{
number: "003",
},
{
number: "004",
},
{
number: "005",
},
{
number: "006",
},
{
number: "007",
},
{
number: "008",
},
{
number: "009",
},
{
number: "010",
},
{
number: "011",
},
{
number: "012",
},
{
number: "013",
},
{
number: "014",
},
{
number: "015",
},
{
number: "016",
},
{
number: "017",
},
{
number: "018",
}
]);
转换为:
let list = ref([
[ {
number: "001",
},
{
number: "002",
},
{
number: "003",
},
{
number: "004",
},
{
number: "005",
},
{
number: "006",
}],
[{
number: "007",
},
{
number: "008",
},
{
number: "009",
},
{
number: "010",
},
{
number: "011",
},
{
number: "012",
}],
[{
number: "013",
},
{
number: "014",
},
{
number: "015",
},
{
number: "016",
},
{
number: "017",
},
{
number: "018",
}]
]);
<div class="paper"
:class="paperHorizon?'wrapper-h':'wrapper-v'"
v-for="(item,index) in list.value"
:key="index"
>
<template v-for="(item2,index2) in item" :key="index2">
<horizontal-card :number="item2.number"></horizontal-card>
</template>
</div>