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 | 类型 | 描述 |
---|---|---|
className | string | undefined | className |
style | React.CSSProperties | undefined | style |
items | React.ReactNode[] | undefined | 需要滚动显示的列表 |
scrollCount | number | undefined | 滚动展示数量,默认为1,超过一条才会滚动 |