Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions packages/rax-swiper/demo/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,30 @@
width: 340rpx;
height: 80rpx;
}

.swiper-pagination {
position: absolute;
top: 10px;
right: 10px;
width: auto !important;
left: auto !important;
margin: 0;
}

.swiper-pagination-bullet {
padding: 5px 10px;
border-radius: 0;
width: auto;
height: 30px;
text-align: center;
line-height: 30px;
font-size: 12px;
color:#000;
opacity: 1;
background: rgba(0,0,0,0.2);
}

.swiper-pagination-bullet-active {
color:#fff;
background: #007aff;
}
8 changes: 7 additions & 1 deletion packages/rax-swiper/demo/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class App extends Component {
}

render() {
const menu = ['Slide 1', 'Slide 2', 'Slide 3', 'Slide 4'];
return (
<View style={{
width: 750
Expand All @@ -33,7 +34,12 @@ class App extends Component {
}}
onSlideChange={() => console.log('slide change')}
onSwiper={(swiper) => swiperEle = swiper}
pagination={{ clickable: true }}
pagination={{
clickable: true,
renderBullet: (index, className) => {
return '<span class="' + className + '">' + (menu[index]) + '</span>';
},
}}
initialSlide={2}
>
<SwiperSlide key="1">Slide 1</SwiperSlide>
Expand Down