Skip to content

Commit 2b7b13f

Browse files
committed
Cleanup code
1 parent e84cfb3 commit 2b7b13f

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

packages/client/internals/QuickOverview.vue

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,13 @@ const numOfRows = computed(() => {
5353
})
5454
5555
const slideRows = computed(() => {
56-
return [...Array(numOfRows.value)].map((_, i) => ({ rowIdx: i, slides: slides.value.slice(i * rowCount.value, (i + 1) * rowCount.value).map((route, j) => ({ route, idx: i * rowCount.value + j })) }))
56+
const cols = rowCount.value
57+
const slideRows = []
58+
for (let i = 0; i < numOfRows.value; i++) {
59+
const row = slides.value.slice(i * cols, (i + 1) * cols)
60+
slideRows.push(row.map((route, j) => ({ route, idx: i * cols + j })))
61+
}
62+
return slideRows
5763
})
5864
5965
const { list: vList, containerProps, wrapperProps } = useVirtualList(
@@ -140,7 +146,7 @@ setTimeout(() => {
140146
>
141147
<div v-bind="wrapperProps">
142148
<div
143-
v-for="{ data: { rowIdx, slides: row } } of vList"
149+
v-for="{ index: rowIdx, data: row } of vList"
144150
:key="rowIdx"
145151
class="flex mb-8"
146152
>

0 commit comments

Comments
 (0)