项目作者: ShredderMing

项目描述 :
Carousel component built with Preact
高级语言: JavaScript
项目地址: git://github.com/ShredderMing/erizabesu.git
创建时间: 2017-10-15T02:42:54Z
项目社区:https://github.com/ShredderMing/erizabesu

开源协议:

下载



erizabesu



Erizabesu(エリザベス)
npm prettier


Carousel component built with Preact.


Install

npm

  1. npm install erizabesu
  2. npm install erizabesu-indicators # optional
  3. npm install erizabesu-arrows # optional

yarn

  1. yarn add erizabesu
  2. yarn add erizabesu-indicators # optional
  3. yarn add erizabesu-arrows # optional

Demos

Usage

  1. import { h } from 'preact';
  2. import Erizabesu from 'erizabesu';
  3. import { Simple as Indicator } from 'erizabesu-indicators';
  4. import { Simple as Arrow } from 'erizabesu-arrows';
  5. const data = [
  6. {
  7. img: 'https://res.cloudinary.com/demo/image/upload/w_600,h_300/sample.jpg',
  8. href: 'http://gintama.wikia.com/wiki/Elizabeth',
  9. target: '_blank',
  10. },
  11. {
  12. img: 'https://res.cloudinary.com/demo/image/upload/w_600,h_300/dog.jpg',
  13. href: 'http://gintama.wikia.com/wiki/Elizabeth',
  14. target: '_blank',
  15. },
  16. {
  17. img: 'https://res.cloudinary.com/demo/image/upload/w_600,h_300/group.jpg',
  18. href: 'http://gintama.wikia.com/wiki/Elizabeth',
  19. target: '_blank',
  20. },
  21. {
  22. img: 'https://res.cloudinary.com/demo/image/upload/w_600,h_300/bike.jpg',
  23. href: 'http://gintama.wikia.com/wiki/Elizabeth',
  24. target: '_blank',
  25. },
  26. {
  27. img: 'https://res.cloudinary.com/demo/image/upload/w_600,h_300/woman.jpg',
  28. href: 'http://gintama.wikia.com/wiki/Elizabeth',
  29. target: '_blank',
  30. },
  31. ];
  32. const SimpleSlider = () => (
  33. <Erizabesu data={data} style={{ width: '600px', height: '300px' }}>
  34. <Indicator ></Indicator>
  35. <Arrow.Prev ></Arrow.Prev>
  36. <Arrow.Next ></Arrow.Next>
  37. </Erizabesu>
  38. );

Props

Props Type Default Value Description
autoplay bool true
autoplaySpeed int 3000 Delay between each auto scroll (in milliseconds)
allowMouseSwipe bool true
data array null [{img:’url’,href:’url’,target:’_blank’},{},{},…]
infinite bool true swipe infinitely