New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
List Component #4905
Comments
List组件计划什么时候可用?现有的组件怎么调制一个List?可不可以直接引入Material-UI的List组件? |
这个预计要到 3.0 才能用,你可以试下 Table[showHeader=false] 能不能满足需求 |
内容形态太多了,只能抽离 content(像 card 一样),但是感觉外框不如 card 统一,不太好搞,除非设计上统一内部内容的部分规范,如新 card 那样。
|
@afc163 @ddcat1115 看看 用法 和 API 是否可行 可配合 Card 使用,变成 Card List。 import { List } from 'antd';
ReactDOM.render(
<div>
<List
toolbars={} // 这两个位置形态固定,所以不抽离成组件,作为配置项
footer={}
>
{/* 水平典型用法 */}
<List.NewItem type='card | normal' />
<List.Item>
<List.Item.logo src='xxx' size={40} radius={40} />
<List.Item.Meta
title="Title"
description="描述"
/>
<List.Item.Content>
Content
</List.Item.Content>
<List.Item.Action>
<a>操作一</a> | <a>操作二</a>
</List.Item.Action>
</List.Item>
{/* 竖直典型用法 */}
<List.Item
vertical // 垂直形态
>
<List.Item.logo src='xxx' size={60} radius={5} />
<List.Item.Meta
title="Title"
description="描述"
tags=['tag 1', 'tag 2', 'tag 3']
extra={<Tags />}
/>
<List.Item.Content>
Content
</List.Item.Content>
<List.Item.Action
actions=[{
icon: '',
text: '156',
href: '',
onClick: () => {},
}]
/>
</List.Item>
</List>
</div>
, mountNode); |
|
toolbars 不要包括在 List 里。 下面这个是 LoadMore,这个要有。而且,List 组件要集成抽象的 infinite load 的功能。 |
不管是横向还是竖向 List,action 位置应该都是固定的(行尾或者尾行),是不是用 prop 比用 child component 好点? |
而且我觉得实现 List 的时候,不用考虑设计稿中的『网格列表』,也就是长得很像 Card 的那一块,因为这块跟普通认知里面的『列表』不一样,用户肯定不会想到去 List 里找这种效果,列表概念本来也比较宽泛,不可能看到一个一个排列的效果都在 List 里实现。 或者这块可以参考下 http://wiki.jikexueyuan.com/project/bootstrap4/components/card/#section-11 |
对,不用考虑,那个就是 Card 和栅格配合。 |
@ddcat1115 action 这里,List 的场景有可能会有扩展: 所以如何抽离成套件的话,再灵活性和规范上面有一个平衡 |
另外也要支持下面的最简用法。 <List.Item>
xxxx
</List.Item> |
actions 这个,要不支持两种:
这样的话,虽然 actions props 确实很蛋疼,但是用起来还是方便不少。 @ddcat1115 怎么看 |
<List.Item actions={array} /> 这样会有什么问题吗?组件做的只是把每一个元素渲染出来,加上分割的竖线,然后渲染位置是固定的 |
不要都支持,选一种。 |
bug
todo
<List grid={{ gutter: 16, column: 4 }}>
<ListItem><Card /></ListItem>
<ListItem><Card /></ListItem>
<ListItem><Card /></ListItem>
<ListItem><Card /></ListItem>
</List> |
@nikogu 目前好像还没实现 scroll infinite load 功能? |
@afc163 是的,还没有实现。。。。争取下周实现了 |
|
|
好的,着手改进~
bisheng 对于 iframe 模式的依赖还需要看一下,暂时改成了 |
|
another issue seems to be if i have a list of cards, and i dont use grid prop in list, the last card item will not get 100% width |
Yes, the width of List children is default to |
Actual: Expected: src: https://github.com/andriijas/create-react-app-playground/blob/master/src/routes/Users.js |
@andriijas https://github.com/andriijas/create-react-app-playground/blob/master/src/routes/Users.js#L60 you need set ...
<List
itemLayout="vertical"
dataSource={data}
... |
thanks. sorry i missed that in the doc. feels a bit strange with horizontal as default but explicit is always better than implicit. |
The text was updated successfully, but these errors were encountered: