1.0.2 • Published 2 years ago

@lstdev/unlimitedcarousel v1.0.2

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

UnlimitedCarousel

无限轮播组件

安装

npm install @lstdev/unlimitedcarousel

基本用法

import React from "react";
import UnlimitedCarousel from "@lstdev/unlimitedcarousel";

export default () => {
    return (
        <>
            <UnlimitedCarousel width={300} height={300} scrollDirect="right">
                <div>
                    123
                </div>
                 <div>
                    456
                </div>
                 <div>
                    789
                </div>
            </UnlimitedCarousel>
        </>
    )
};

Props

width

必需值number类型,容器宽度。

height

必需值number类型,容器高度。

margin

可选值number类型,为滚动项之间的外间距。

autoScroll

可选值boolean类型,默认值为true,是否开启自动轮播

scrollSpeed

可选值number类型,默认值2, 设置轮播速度为x秒滚动一次。

scrollDirect

必须值string类型,"left" | "right" | "top" | "bottom",轮播方向

showButton

可选值boolean类型,默认为false,展示上下切换按钮

cb

可选值Function类型,当前轮播想动画结束时回调方法,返回当前轮播项的下标值。

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago