首先说一下,若是你们喜欢可直接收藏我这个项目的github地址。https://github.com/951565664/... 由于有可能github上版本更新了,可是这边就不更新了。若是有什么问题,能够随时问,建议不要QQ或者私信,直接上github提issues,能把问题记录下来,方便其余人查找。react
a lightweight Slider component built with react.
一个轻量级的 react 轮播组件git
Important: be sure that you have installed react. bash
重要提醒:请确保先安装了 react.app
# Install $ npm install react-slider-light
import React, { Component } from 'react'; import Slider from 'react-slider-light'; export default class Wrapper extends Component { render(){ return <Slider> <div>page1</div> <div>page2</div> </Slider > } }
Want to run demos locally 本地启动演示ide
git clone https://github.com/951565664/react-slider-light.git cd react-slick npm install npm start open http://localhost:8080
Props | Type | Default Value | Description | Required |
---|---|---|---|---|
defaultSliderIndex |
number |
0 |
默认初始滑动开始位置 | No |
sliderIndex |
number |
0 |
控制滑动的页面 | No |
delay |
number |
1800 |
延迟的时间 (ms) | No |
speed |
number |
500 |
延迟的时间 (ms) | No |
sliderToShow |
number |
1 |
每次展现页面 | No |
sliderToScroll |
number |
1 |
每次滚动的页面数量 | No |
autoPaly |
bool |
true |
是否自动开始轮播 | No |
isDots |
bool |
false |
是否须要dots | No |
dots |
enum or func |
circle |
dots 的种类,值为circle,gallery,diamond,square,({index,item})=>{ return ReactDom} | No |
dotStyle |
object |
{listStyle: 'none',display: 'inline-block',margin: '0px 8px',cursor: 'pointer',overflow:'hidden'} |
dots 的样式 | |
dotX |
string or number |
center |
dot的水平位置 ,能够是right left center 这样的字符串 ,也能够是 30 -20, 表示距离左边的像素,负数表示距右边的像素 |
No |
dotY |
string or number |
middle |
dot的垂直位置 ,能够是top bottom middle 这样的字符串 ,也能够是 30 -20, 表示距离底部的像素,负数表示距顶部的像素 |
No |
isArrows |
bool |
false |
是否须要箭头 | No |
arrowRender |
func |
null |
箭头的渲染函数 (type)=>{//type:'backward ' .'forward'} |
No |
arrowsY |
string or number |
middle |
arrows的垂直位置 ,能够是top bottom middle 这样的字符串 ,也能够是 30 -20, 表示距离底部的像素,负数表示距顶部的像素 |
No |
Please replicate your issue with CodeSandbox template and post it along with issue to make it easy for me to debug.post
2018-2-15
测试
2018-2-25
2018-2-25
2018-6-19
Of course, at least 4 hours a week will be taken out for maintenance and development
固然会,至少每周会抽出4个小时来维护和开发
No. 想多了老铁