1.0.0 • Published 5 years ago

remax-window v1.0.0

Weekly downloads
5
License
MIT
Repository
github
Last release
5 years ago

Remax Window

npm

Remax 长列表组件,解决长列表的性能问题

Remax Window 借鉴了 React Window 的实现,因此基本沿用了 React Window 的用法。

安装使用

$ npm install remax-window --save
import { View } from 'remax/wechat';
import { FixedSizeList } from 'remax-window';

export default () => {
  const data = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
  return (
    <FixedSizeList height={150} itemCount={data.length} itemSize={35}>
      {data.map(item => (
        <View style={{ height: '35rpx' }} key={item}>
          {item}
        </View>
      ))}
    </FixedSizeList>
  );
};

API

FixedSizeList

属性名类型必填默认值描述
classNamestringclass 样式名称
styleReact.CSSPropertiesReact 行内样式
itemCountnumber列表里 item 的个数
itemSizenumber | string每个 item 的高度,支持 rpx 和 px。默认 rpx 单位。如:35(默认 rpx 单位), '35rpx', '35px'
overscanCountnumber5预加载的 item 个数
onReachBottom() => voidscroll 触底回调
reachBottomThresholdnumberonReachBottom 触发阈值,默认使用 overscanCount
1.1.0-0

5 years ago

1.0.0

5 years ago

1.0.0-alpha.5

5 years ago

1.0.0-alpha.4

5 years ago

1.0.0-alpha.3

5 years ago

1.0.0-alpha.2

5 years ago

1.0.0-alpha.1

5 years ago