('auto');
+ const perPage = ref(3);
+ const carouselItem = ref(null);
+
const { getImageUrl } = useDirectusImage();
+ const { height } = useElementSize(carouselItem);
const solutions = computed(
() => props.homepageData?.recommendSolutions || []
);
+ const pages = computed(() =>
+ Math.ceil(solutions.value.length / perPage.value)
+ );
+
+ const updatePerPage = () => {
+ const width = window.innerWidth;
+ if (width < 768) {
+ perPage.value = 1;
+ } else if (width < 1024) {
+ perPage.value = 2;
+ } else {
+ perPage.value = 3;
+ }
+ };
+
+ const pageSolutions = (n: number) => {
+ return solutions.value.slice((n - 1) * perPage.value, n * perPage.value);
+ };
const handleSolutionCardClick = (documentId: string) => {
// 使用路由导航到产品详情页
@@ -76,6 +100,22 @@
router.push(localePath(`/solutions/${documentId}`));
}
};
+
+ watch(height, (h) => {
+ if (h > 0) {
+ carouselHeight.value = h + 40 + 'px';
+ console.log('carouselHeight updated:', carouselHeight.value);
+ }
+ });
+
+ onMounted(() => {
+ updatePerPage();
+ window.addEventListener('resize', updatePerPage);
+ });
+
+ onBeforeUnmount(() => {
+ window.removeEventListener('resize', updatePerPage);
+ });
--
2.49.0
From 3b6857637b1de0179835ec40ffe00123f75b2428 Mon Sep 17 00:00:00 2001
From: R2m1liA <15258427350@163.com>
Date: Sat, 1 Nov 2025 16:05:59 +0800
Subject: [PATCH 4/8] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4footer=E8=A1=8C?=
=?UTF-8?q?=E4=B8=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/components/shared/JinshenFooter.vue | 6 +++++-
app/layouts/default.vue | 6 ------
2 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/app/components/shared/JinshenFooter.vue b/app/components/shared/JinshenFooter.vue
index 017c189..f3e388c 100644
--- a/app/components/shared/JinshenFooter.vue
+++ b/app/components/shared/JinshenFooter.vue
@@ -1,6 +1,6 @@