Skip to content

Commit 65fc79f

Browse files
[autofix.ci] apply automated fixes
1 parent 26f7bbb commit 65fc79f

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

app/composables/useVisibleItems.ts

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,24 @@
1-
export function useVisibleItems<T>(
2-
items: MaybeRefOrGetter<T[]>,
3-
limit: number,
4-
) {
1+
export function useVisibleItems<T>(items: MaybeRefOrGetter<T[]>, limit: number) {
52
const showAll = shallowRef(false)
63

74
const visibleItems = computed(() => {
85
const list = toValue(items)
96
return showAll.value ? list : list.slice(0, limit)
107
})
118

12-
const hiddenCount = computed(() =>
13-
Math.max(0, toValue(items).length - limit),
14-
)
9+
const hiddenCount = computed(() => Math.max(0, toValue(items).length - limit))
1510

16-
const hasMore = computed(
17-
() => !showAll.value && toValue(items).length > limit,
18-
)
11+
const hasMore = computed(() => !showAll.value && toValue(items).length > limit)
1912

20-
const expand = () => { showAll.value = true }
21-
const collapse = () => { showAll.value = false }
22-
const toggle = () => { showAll.value = !showAll.value }
13+
const expand = () => {
14+
showAll.value = true
15+
}
16+
const collapse = () => {
17+
showAll.value = false
18+
}
19+
const toggle = () => {
20+
showAll.value = !showAll.value
21+
}
2322

2423
return { visibleItems, hiddenCount, hasMore, showAll, expand, collapse, toggle }
2524
}

0 commit comments

Comments
 (0)