2.0.3 • Published 7 years ago

react-m-carousel v2.0.3

Weekly downloads
31
License
-
Repository
github
Last release
7 years ago

react-m-carousel


React Carousel Component for mobile

NPM version npm download

2.0 change log

更小的体积,更少的依赖,更高的性能,更方便的扩展

  1. 更新react版本16.4
  2. 更新编译工具webpack到4.11
  3. 重构了所有代码,提升了性能,减小了体积(8.5KiB -> 5.26KiB)
  4. 去掉了除react之外的依赖

下面是最新的编译信息

  • Hash: 06bcfa1e2772b05a9184
  • Version: webpack 4.11.0
  • Time: 1264ms
  • Built at: 2018-06-08 13:19:12
AssetSizeChunksChunk Names
ReactMCarousel.js5 KiB0emittedmain

Development

npm install
npm run dev

Live Example

online example: http://shiye515.github.io/react-m-carousel/

install

react-m-carousel

Usage

npm i -save react-m-carousel

import React from 'react'
import ReactDOM from 'react-dom'
import ReactMCarousel from 'react-m-carousel'

ReactDOM.render(<ReactMCarousel><div>1</div><div>1</div></ReactMCarousel>, container);

详细用法可以看examples文件夹里的demo

关于 indicator

不再默认提供,可以自己随意定制,通过props传入即可。自己的实现可以参考src/indicator.js

API

props

PropertyTypeDefaultDescription
classNameString''css class
responsiveNumber40响应式高度,表示宽度的百分比值置
loopBooleanfalse循环播放
autoNumber0大于0的值会设置自动播放,值为自动播放的interval
onSwipingBoolean, Function(Float percent)false触摸时的回调,percent为移动的距离与宽度的比值
onAnimationEndBoolean, Function(Int activeIndex)false动画结束的回调,activeIndex是当前的序号
deltaNumber50移动超过参数值才会播放下一张
activeNumber0加载时默认展示的序号
indicatorFunction(childrenLength,active):ReactNodefalse渲染indicator
flickThresholdNumber0.6快速滑动的最低速度

License

react-m-carousel is released under the MIT license.

2.0.3

7 years ago

2.0.2

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.1.0

8 years ago

1.0.10

10 years ago

1.0.9

10 years ago

1.0.8

10 years ago

1.0.6

10 years ago

1.0.5

10 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago