1.0.1-react16 • Published 6 years ago

awesome-react16-swiper v1.0.1-react16

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

Swiper

基于 React 实现的移动端 Swiper 组件

演示

image

版本说明

本项目分为两个版本,源码相同,只是在发布时,我会更换 reactreact-dom 相应的版本,再进行发布

  • React15:
    • 链接:awesome-react15-swiper
    • 安装:npm install awesome-react15-swiper
  • React16:
    • 链接:awesome-react16-swiper
    • 安装:npm install awesome-react16-swiper

本地开发

yarn
npm run start

使用

import Swiper from 'awesome-react15-swiper';
import 'awesome-react15-swiper/lib/index.css';

let params = {
    observer: true,
    slideChange: (index) => {
        console.log(index);
    }
}
<Swiper {...params}>
    <div>1</div>
    <div>2</div>
    <div>3</div>
</Swiper>

兼容性

  • Android4+
  • Ios8+

Api

参数类型默认值说明
speedNumber0.3动画完成时间,即 transition-duration
distanceNumber50触摸滑动距离小于 distance,则不翻到下一张
autoPlayBooleantrue自动播放
paginationBooleantrue分页
observerBooleanfalse监视器

未完成的

  • 一个页面有多个 Swiper 的情况
1.0.1-react16

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago