提交 8c465081 编写于 作者: D DCloud_LXH

chore(h5): swiper navigation

上级 af4606c1
...@@ -843,9 +843,15 @@ const useSwiperNavigation = /*#__PURE__*/ ( ...@@ -843,9 +843,15 @@ const useSwiperNavigation = /*#__PURE__*/ (
onMouseout: (event: MouseEvent) => navigationHover(event, 'out'), onMouseout: (event: MouseEvent) => navigationHover(event, 'out'),
} }
function navigationClick($event: MouseEvent, type: NavigationClickType) { function navigationClick(
$event: MouseEvent,
type: NavigationClickType,
disabled: boolean
) {
$event.stopPropagation() $event.stopPropagation()
if (disabled) return
const swiperItemLength = swiperContext.value.length const swiperItemLength = swiperContext.value.length
let _current = state.current let _current = state.current
...@@ -929,7 +935,7 @@ const useSwiperNavigation = /*#__PURE__*/ ( ...@@ -929,7 +935,7 @@ const useSwiperNavigation = /*#__PURE__*/ (
}, },
navigationClass navigationClass
)} )}
onClick={(e) => navigationClick(e, 'prev')} onClick={(e) => navigationClick(e, 'prev', prevDisabled)}
{...navigationAttr} {...navigationAttr}
> >
{createNavigationSVG()} {createNavigationSVG()}
...@@ -943,7 +949,7 @@ const useSwiperNavigation = /*#__PURE__*/ ( ...@@ -943,7 +949,7 @@ const useSwiperNavigation = /*#__PURE__*/ (
}, },
navigationClass navigationClass
)} )}
onClick={(e) => navigationClick(e, 'next')} onClick={(e) => navigationClick(e, 'next', nextDisabled)}
{...navigationAttr} {...navigationAttr}
> >
{createNavigationSVG()} {createNavigationSVG()}
......
...@@ -100,8 +100,7 @@ uni-swiper[hidden] { ...@@ -100,8 +100,7 @@ uni-swiper[hidden] {
.uni-swiper-navigation-disabled { .uni-swiper-navigation-disabled {
opacity: 0.35; opacity: 0.35;
cursor: auto; cursor: not-allowed;
pointer-events: none;
} }
.uni-swiper-navigation-hide { .uni-swiper-navigation-hide {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册