Skip to content

Commit

Permalink
feat(list): card list support selected (ant-design#3666)
Browse files Browse the repository at this point in the history
* fix: 测试

* feat: 卡片列表支持选中和内容自定义

* fix: 取消对procard title条件赋值的方式

* fix: 删除冗余代码

* update

Co-authored-by: liuxulian.lxl <[email protected]>
Co-authored-by: chenshuai2144 <[email protected]>
  • Loading branch information
3 people authored Sep 16, 2021
1 parent 2f44f3a commit 282640a
Show file tree
Hide file tree
Showing 2 changed files with 176 additions and 138 deletions.
10 changes: 8 additions & 2 deletions packages/list/src/Item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 150,7 @@ function ProListItem<RecordType>(props: ItemProps<RecordType>) {

const className = classNames(
{
[`${propsClassName}-selected`]: selected,
[`${propsClassName}-selected`]: !cardProps && selected,
[`${propsClassName}-show-action-hover`]: showActions === 'hover',
[`${propsClassName}-type-${type}`]: !!type,
[`${propsClassName}-editable`]: isEditable,
Expand Down Expand Up @@ -262,7 262,13 @@ function ProListItem<RecordType>(props: ItemProps<RecordType>) {
subTitle={subTitle}
extra={actionsDom}
>
{content}
<Skeleton avatar title={false} loading={loading} active>
<div className={`${className}-header`}>
{!!checkbox && <div className={`${className}-checkbox`}>{checkbox}</div>}
{itemTitleRender && itemTitleRender?.(record, index, titleDom)}
{content}
</div>
</Skeleton>
</ProCard>
);
return (
Expand Down
Loading

0 comments on commit 282640a

Please sign in to comment.