From 599ac92a2bf868035b9063845c0b69856f3a3e18 Mon Sep 17 00:00:00 2001 From: hayden Date: Sat, 2 Nov 2024 20:07:58 +0800 Subject: [PATCH] fix: Adjust mobile itemSize for virtual scrolling --- src/components/DialogManager.vue | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/components/DialogManager.vue b/src/components/DialogManager.vue index 84c83e8..721e0ec 100644 --- a/src/components/DialogManager.vue +++ b/src/components/DialogManager.vue @@ -41,7 +41,7 @@ @@ -120,6 +120,17 @@ const sortOrderOptions = ref( }), ) +const itemSize = computed(() => { + let itemWidth = cardWidth + let itemGutter = gutter + if (isMobile.value) { + const baseSize = 16 + itemWidth = window.innerWidth - baseSize * 2 * 2 + itemGutter = baseSize * 2 + } + return itemWidth / aspect + itemGutter +}) + const colSpan = ref(1) const colSpanWidth = ref(cardWidth)