1.0.1 • Published 3 years ago

@dumi-antd/pro-list v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

🏆 Use Ant Design List like a Pro!

ProList (高级列表)

ProList 在 antd 的 list 支持了一些功能,比如 多选,展开等功能,使用体验贴近 table。

何时使用

在完成一个标准的列表时即可使用。

API

ProList

ProList 与 antd 的 List 相比,主要增加了 rowSelection 和 expandable 来支持选中与筛选

参数说明类型默认值
rowSelection与 antd 相同的配置object |booleanfalse
expandable与 antd 相同的配置object | false-
showActions何时展示 actions'hover' | 'always'always
rowKey行的 key,一般是行 idstring | (row,index)=>string"id"
renderItem现在的 renderItem 需要返回 ProList.Item 的 props,而不是 domItemProps-
listRenderItem这是 antd 的 renderItem 的别名(row,index)=> Node-

ProList.Item

如果你的 dataSource 包含 children,我们会将其打平传入到 renderItem 中,但是包含 children 的项会转化了 group 的样式,只支持 title 和 actions 的属性。

参数说明类型默认值
type列表项的预设样式new | top-
title列表项的主标题ReactNode-
subTitle列表项的副标题ReactNode-
checkbox列表的选择框React.ReactNode-
loading列表项是否在加载中React.ReactNode-
avatar列表项的头像AvatarProps | string-
actions操作列表项React.ReactNode[]-
description列表项的描述,与 title 不在一行React.ReactNode[]-
expandedRowClassName额外展开的 cssstring-
expand列表项是否展开boolean-
onExpand列表项展开收起的回调(expand: boolean) => void-
expandable列表项展开配置object-