Skip to content

AutoScrollBox

自动滚动效果的容器

示例



鼠标指上可以滚动
点我查看代码
tsx
import { AutoScrollBox } from "@wenonly/react-components";
import { Card } from "antd";
import React from "react";

const RCAutoScrollBox: React.FunctionComponent = () => {
  return (
    <AutoScrollBox
      style={{ height: 300 }}
      items={Array(10)
        .fill(1)
        .map((item, index) => (
          <Card key={index}>{index}</Card>
        ))}
    ></AutoScrollBox>
  );
};

export default RCAutoScrollBox;

参数

key类型描述
classNamestring | undefinedclassName
styleReact.CSSProperties | undefinedstyle
itemsReact.ReactNode[] | undefined需要滚动显示的列表
scrollCountnumber | undefined滚动展示数量,默认为1,超过一条才会滚动