From 4b65ca6ea0336a721ed17e81a6374eec07c8c9e3 Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Sat, 15 Jun 2024 15:37:07 +0800 Subject: [PATCH] fix --- themes/heo/components/MenuItemDrop.js | 2 - themes/heo/components/Swipe.js | 91 ++++++++++++++------------- 2 files changed, 47 insertions(+), 46 deletions(-) diff --git a/themes/heo/components/MenuItemDrop.js b/themes/heo/components/MenuItemDrop.js index 2e8709ff..0b9c3053 100644 --- a/themes/heo/components/MenuItemDrop.js +++ b/themes/heo/components/MenuItemDrop.js @@ -13,8 +13,6 @@ export const MenuItemDrop = ({ link }) => {
changeShow(true)} onMouseOut={() => changeShow(false)}> - {' '} - menu-link pl-2 pr-4 no-underline tracking-widest pb-1 {/* 不含子菜单 */} {!hasSubMenu && ( { + const handleClick = item => { if (isBrowser) { window.open(item?.url) } @@ -24,50 +24,53 @@ export function Swipe({ items }) { }, [activeIndex, items.length]) return ( -
- {items.map((item, index) => ( -
handleClick(item)} - key={index} - className={`absolute top-0 bottom-0 w-full h-full flex justify-center items-center line-clamp-1 transform transition-transform duration-500 ${index === activeIndex ? 'translate-y-0 slide-in' : 'translate-y-full slide-out' - }`} - > - {item.title} -
- ))} - +
+ {items.map((item, index) => ( +
handleClick(item)} + key={index} + className={`whitespace-nowrap absolute top-0 bottom-0 w-full h-full flex justify-center items-center line-clamp-1 transform transition-transform duration-500 ${ + index === activeIndex + ? 'translate-y-0 slide-in' + : 'translate-y-full slide-out' + }`}> + {item.title}
+ ))} + + +
) -}; +} export default Swipe