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'] ?? ''}