From 46d63ef88a675ce66e96f55e56247cac7d49e1bf Mon Sep 17 00:00:00 2001 From: peijunlei Date: Wed, 2 Sep 2026 17:54:08 +0800 Subject: [PATCH] =?UTF-8?q?feat(solution2):=20=E6=9D=A1=E6=95=B0=20?= =?UTF-8?q?=E2=89=A43=20=E6=97=B6=E9=9A=90=E8=97=8F=E7=AE=AD=E5=A4=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/themes/dist_static/static/js/solution2.js | 7 +++++++ public/themes/website/1/zh/demo/solution2.html | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/public/themes/dist_static/static/js/solution2.js b/public/themes/dist_static/static/js/solution2.js index bf92b4e..7c7b128 100644 --- a/public/themes/dist_static/static/js/solution2.js +++ b/public/themes/dist_static/static/js/solution2.js @@ -75,6 +75,13 @@ function initMoreSwiper() { const root = document.querySelector(".sl2-more"); const el = root?.querySelector(".sl2-more__swiper"); if (!root || !el || !window.Swiper) return; + const slideCount = el.querySelectorAll(".swiper-wrapper > .swiper-slide").length; + // 一屏展示 3 条,不超过 3 条时隐藏切换按钮 + if (slideCount <= 3) { + root.querySelectorAll(".sl2-more__head .s-arrows, .sl2-more__arrows-mobile").forEach((node) => { + node.style.display = "none"; + }); + } new window.Swiper(el, { slidesPerView: 3, spaceBetween: 40, diff --git a/public/themes/website/1/zh/demo/solution2.html b/public/themes/website/1/zh/demo/solution2.html index 05de8ea..b95e97d 100644 --- a/public/themes/website/1/zh/demo/solution2.html +++ b/public/themes/website/1/zh/demo/solution2.html @@ -199,7 +199,7 @@ $current_cate_id = $current_cate['id'] ?? 0; {/if} {if !empty($sub_cates[5])} - +

{$sub_cates[5]['title'] ?? ''}