From 07418505e551a7897a265c15cee2233122ce774c Mon Sep 17 00:00:00 2001 From: DCloud_LXH <283700113@qq.com> Date: Mon, 17 Oct 2022 11:36:25 +0800 Subject: [PATCH] chore(h5): swiper navigation --- src/core/view/components/swiper/index.vue | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/core/view/components/swiper/index.vue b/src/core/view/components/swiper/index.vue index 213b16c47..4f6d08a51 100644 --- a/src/core/view/components/swiper/index.vue +++ b/src/core/view/components/swiper/index.vue @@ -638,9 +638,11 @@ export default { this.circularEnabled ? 1 : 0 ) }, - _navigationClick ($event, type) { + _navigationClick ($event, type, disabled) { $event.stopPropagation() + if (disabled) return + const swiperItemLength = this.items.length let _current = this.currentSync @@ -796,7 +798,7 @@ export default { 'div', { on: { - click: (e) => this._navigationClick(e, 'prev'), + click: (e) => this._navigationClick(e, 'prev', this.prevDisabled), ...navigationEvent }, class: [ @@ -814,7 +816,7 @@ export default { 'div', { on: { - click: (e) => this._navigationClick(e, 'next'), + click: (e) => this._navigationClick(e, 'next', this.nextDisabled), ...navigationEvent }, class: [ @@ -949,8 +951,7 @@ uni-swiper .uni-swiper-navigation { uni-swiper .uni-swiper-navigation-disabled { opacity: 0.35; - cursor: auto; - pointer-events: none; + cursor: not-allowed; } uni-swiper .uni-swiper-navigation-hide { -- GitLab