Skip to content

Self-hosted personal gallery application with online photo management and albums, supporting Live/Motion Photos, EXIF parsing, geolocation recognition, and an explore map.

fix(masonry): 调整瀑布流最大列数

Timothy Yin85ba1c99e5ae
diff --git a/app/components/masonry/Root.vue b/app/components/masonry/Root.vue
index 4b18aa9f..41702498 100644
--- a/app/components/masonry/Root.vue
+++ b/app/components/masonry/Root.vue
@@ -15,6 +15,7 @@ const router = useRouter()
const FIRST_SCREEN_ITEMS_COUNT = 30
const COLUMN_GAP = 4
const AUTO_COLUMN_WIDTH = 280
+const MAX_COLUMN_COUNT = 7
const MIN_COLUMN_COUNT = 2
// Reactive state
@@ -38,7 +39,7 @@ const columnCount = computed(() => {
if (!containerWidth.value) return MIN_COLUMN_COUNT
const availableWidth = containerWidth.value - (isMobile.value ? 16 : 32)
- const maxColumns = isMobile.value ? 2 : 6
+ const maxColumns = isMobile.value ? 2 : MAX_COLUMN_COUNT
const calculatedColumns = Math.floor(
(availableWidth + COLUMN_GAP) / (AUTO_COLUMN_WIDTH + COLUMN_GAP),
)