1.0.8 • Published 4 years ago

taro-list v1.0.8

Weekly downloads
120
License
-
Repository
github
Last release
4 years ago

taro-list

支持下拉刷新 、 加载更多 、虚拟列表

安装及使用

npm i taro-list

h5 demo

小程序 demo

小程序 demo

  1. 配置文件里添加
 copy: {
    patterns: [
      {
        from:  'node_modules/taro-list/dist/weapp/components/List/refresh.wxs',
        to:  'dist/npm/taro-list/dist/weapp/components/List/refresh.wxs',
      },
      {
        from:  'node_modules/taro-list/dist/weapp/components/List/index.template.wxml',
        to:  'dist/npm/taro-list/dist/weapp/components/List/index.template.wxml',
      }
    ]
  },
  1. 使用
import Taro  from '@tarojs/taro';
import TaroList from 'taro-list'

export default Index() => {

  return (
    <TaroList height="100vh" onRefresh={cb => {
      console.log('刷新');

      setTimemout(cb, 1000);
    }}>
  </TaroList>)
}

具体使用可查看 https://github.com/raohong/taro-list/tree/master/src/pages

taro-list

属性类型默认值必填说明
heightnumber/string0组件高度,支持 css
widthnumber/string0组件宽度,支持 css
classNamestring容器类名
styleReact.CSSProperties容器样式
disabledboolean禁用下拉刷新
distanceToRefreshnumber60刷新距离
dampingnumber200最大下拉距离
refreshingboolean是否处于刷新状态 (最大刷新时间 10s)
onRefresh(onSuccess: () => void) => void刷新回调函数,参数 onSuccess 调用结束刷新状态
onVirtualListInit() => void虚拟列表初始化回调
onLoadMore() => void下拉加载更多回调函数
enableBackToTopboolean参考 ScrollView enableBackToTop
scrollWithAnimationboolean参考 ScrollView scrollWithAnimation
virtualboolean是否启用虚拟滚动
dataManagerobject当启用虚拟滚动时, 必传VirtualList Data Manager
scrollToIndexnumber容器滚动 item index
alignALIGNALIGN.CENTER设置 scrollToIndex 滚动时滚动值对其方式

taro-list-data-manager

taro-list-data-manager 文档 https://github.com/raohong/taro-list-data-manager

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.2

4 years ago

1.0.0

4 years ago

1.0.3

4 years ago

0.3.4

4 years ago

0.3.3

4 years ago

0.3.2

4 years ago

0.3.1

4 years ago

0.3.0

4 years ago

0.2.3

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.1.8

4 years ago

0.1.7

4 years ago

0.1.9

4 years ago

0.1.4

4 years ago

0.2.2

4 years ago

0.1.3

4 years ago

0.1.6

4 years ago

0.1.5

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago