File tree 2 files changed +32
-2
lines changed
packages/core/src/components/Swiper
2 files changed +32
-2
lines changed Original file line number Diff line number Diff line change @@ -147,6 +147,24 @@ function SwiperExample() {
147
147
/>
148
148
</ View >
149
149
</ Section >
150
+
151
+ < Section title = "Hide Dots Example" style = { undefined } >
152
+ < Swiper
153
+ vertical = { false }
154
+ hideDots
155
+ style = { { width : "100%" , height : 300 } }
156
+ >
157
+ < SwiperItem style = { [ style . item , { backgroundColor : "#fdd3d3" } ] } >
158
+ < Text > Test Slide 1</ Text >
159
+ </ SwiperItem >
160
+ < SwiperItem style = { [ style . item , { backgroundColor : "#d6d3fd" } ] } >
161
+ < Text > Test Slide 2</ Text >
162
+ </ SwiperItem >
163
+ < SwiperItem style = { [ style . item , { backgroundColor : "#c9fdd9" } ] } >
164
+ < Text > Test Slide 3</ Text >
165
+ </ SwiperItem >
166
+ </ Swiper >
167
+ </ Section >
150
168
</ Container >
151
169
) ;
152
170
}
Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ export interface SwiperProps<T> {
33
33
minDistanceForAction ?: number ;
34
34
minDistanceToCapture ?: number ;
35
35
theme : ReadTheme ;
36
+ hideDots ?: boolean ;
36
37
}
37
38
38
39
const Swiper = forwardRef < SwiperRef , SwiperProps < any > > (
@@ -61,6 +62,7 @@ const Swiper = forwardRef<SwiperRef, SwiperProps<any>>(
61
62
minDistanceForAction,
62
63
minDistanceToCapture,
63
64
style,
65
+ hideDots = false ,
64
66
} : SwiperProps < any > ,
65
67
ref
66
68
) => {
@@ -157,10 +159,20 @@ const Swiper = forwardRef<SwiperRef, SwiperProps<any>>(
157
159
nextTitleStyle : { color : nextTitleColor } ,
158
160
dotsTouchable,
159
161
...( dotColor
160
- ? { dotProps : { badgeStyle : { backgroundColor : dotColor } } }
162
+ ? {
163
+ dotProps : {
164
+ badgeStyle : {
165
+ backgroundColor : hideDots ? "transparent" : dotColor ,
166
+ } ,
167
+ } ,
168
+ }
161
169
: { } ) ,
162
170
...( dotActiveColor
163
- ? { dotActiveStyle : { backgroundColor : dotActiveColor } }
171
+ ? {
172
+ dotActiveStyle : {
173
+ backgroundColor : hideDots ? "transparent" : dotActiveColor ,
174
+ } ,
175
+ }
164
176
: { } ) ,
165
177
} }
166
178
>
You can’t perform that action at this time.
0 commit comments