From 90b314d3b62794e9c3ec624a4d8e11bff080d340 Mon Sep 17 00:00:00 2001 From: peijunlei Date: Thu, 10 Sep 2026 19:32:15 +0800 Subject: [PATCH] =?UTF-8?q?feat(solution.js):=20=E6=A0=B8=E5=BF=83?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F/=E4=BA=A7=E5=93=81=E8=B6=85=E8=BF=873?= =?UTF-8?q?=E4=B8=AA=E6=89=8D=E5=B1=95=E7=A4=BA=E5=88=87=E6=8D=A2=E6=8C=89?= =?UTF-8?q?=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/themes/dist_static/static/js/solution.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/public/themes/dist_static/static/js/solution.js b/public/themes/dist_static/static/js/solution.js index f1fa558..34d0e16 100644 --- a/public/themes/dist_static/static/js/solution.js +++ b/public/themes/dist_static/static/js/solution.js @@ -12,10 +12,18 @@ function initCoreSwiper() { const root = document.querySelector(".sl-core"); const el = root?.querySelector(".sl-core__swiper"); if (!root || !el || !window.Swiper) return; + const slideCount = el.querySelectorAll(".swiper-wrapper > .swiper-slide").length; + // 一屏展示 3 条,不超过 3 条时隐藏切换按钮 + if (slideCount <= 3) { + root.querySelectorAll(".sl-core__head .s-arrows").forEach((node) => { + node.style.display = "none"; + }); + } new window.Swiper(el, { slidesPerView: 3, spaceBetween: 40, speed: 600, + watchOverflow: true, navigation: { prevEl: root.querySelector(".sl-core__head .s-arrows__prev"), nextEl: root.querySelector(".sl-core__head .s-arrows__next")