0.1.28 • Published 5 years ago

rat-slider v0.1.28

Weekly downloads
3
License
BSD-3-Clause
Repository
github
Last release
5 years ago

rat-slider

组件介绍

轮播图组件

demo

import Slider from 'rat-slider';
import View from 'rat-view';
import Picture from 'rat-picture';

const slides = [
    { url: 'https://img.alicdn.com/tps/TB1bewbNVXXXXc5XXXXXXXXXXXX-1000-300.png', text: 'Tape Player Skin Design Competition' },
    { url: 'https://img.alicdn.com/tps/TB1xuUcNVXXXXcRXXXXXXXXXXXX-1000-300.jpg', text: 'Mobile Phone Taobao Skin Call' },
    { url: 'https://img.alicdn.com/tps/TB1ikP.NVXXXXaYXpXXXXXXXXXX-1000-300.jpg', text: 'Design Enabling Public Welfare' },
    { url: 'https://img.alicdn.com/tps/TB1s1_JNVXXXXbhaXXXXXXXXXXX-1000-300.jpg', text: 'Amoy Doll Design Competition' },
];

const itemNodes = slides.map((item, index) => <View key={index} style={{width'100%', height,}}><Picture source={{uri:item.url}} alt={item.text} /></View>);

render(<Slider>{itemNodes}</Slider>, mountNode);

api

参数说明类型默认值是否必填
dots是否显示导航锚点Booleantrue
dotsStyle统一修改导航锚点样式Object{}
autoplay是否自动轮播Booleanfalse
autoplaySpeed动效类型,支持'slide'和'fade'String'slide'
animation轮播间隔时间number3000
speed轮播速度number500
arrows是否显示箭头Booleantrue
preArrowStyle箭头样式修改object{}
nextArrowStyle箭头样式修改object{}
dotRender自定义导航锚点 dotsRender={(index, current) => {return {index};}}>Function
triggerType锚点导航触发方式 可选值: 'click', 'hover'Enum'click'
onChange轮播切换的回调函数 签名:Function(index: Number) => void 参数:index: {Number} 幻灯片的索引Function
0.1.28

5 years ago

0.1.27

6 years ago

0.1.26

6 years ago

0.1.25

6 years ago

0.1.24

6 years ago

0.1.23

7 years ago

0.1.22

7 years ago

0.1.21

7 years ago

0.1.20

7 years ago

0.1.19

7 years ago

0.1.18

7 years ago

0.1.17

7 years ago

0.1.16

7 years ago

0.1.15

7 years ago

0.1.14

7 years ago

0.1.13

7 years ago

0.1.11

7 years ago

0.1.10

7 years ago

0.1.9

7 years ago

0.1.8

7 years ago

0.1.6

7 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago