Welink React-ui表单组件List
List
单行列表。List UI 提供与WeLink规范一致的视图。 List组件内容包括:标题列表、图文列表、带图文跳转。
参数说明
Cell
参数 | 类型 | 默认值 | 说明 |
---|---|---|---|
access | bool | false | 是否需要箭头 |
list | bool | false | 是否需要内部上下间距格式 |
component | func | - | 传递组件替换单元格 |
link | bool | false | 是否为链接 |
CellHeader、CellBody、CellFooter
参数 | 类型 | 默认值 | 说明 |
---|---|---|---|
primary | bool | false | 是否为主模块 |
import React from 'react';
import {
Cells,
CellsTitle,
Cell,
CellHeader,
CellHeaderImage,
CellBody,
CellBodySubText,
CellBodyExplan,
CellFooter,
CellFooterImage
} from '@wecode/react-weui';
const iconSrc = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAACgCAIAAAAErfB6AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDc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gGBAOCEQwIBgQDggHBgGBAMCAYwYBgQDAgGBAMCAYEIxgQDAgGBAOCAcGAYAQDggHBgGBAMCAYEAwIRjAgGBAMCAYEA4IBwQgGBAOCAcGAYEAwIBjBgGBAMCAYPp//BBgAStflVPGsRa8AAAAASUVORK5CYII=';
const cellFooterIconStyle = {
display: 'inline-block',
width: '16px',
marginLeft: '12px',
verticalAlign: 'middle'
};
const cellHeaderStyle = { display: 'block', width: '24px', marginRight: '14px' };
const ListDemo = () => (
<div>
<CellsTitle>主文本+次文本</CellsTitle>
<Cells>
<Cell list>
<CellBody>主文本</CellBody>
<CellFooter>次文本</CellFooter>
</Cell>
</Cells>
<CellsTitle>主文本+次文本(可选)+提示性图标</CellsTitle>
<Cells>
<Cell href="javascript:;" access list>
<CellBody>主文本</CellBody>
<CellFooter>次文本</CellFooter>
</Cell>
<Cell access list>
<CellBody>主文本</CellBody>
<CellFooter>次文本</CellFooter>
</Cell>
</Cells>
<Cells>
<Cell list>
<CellBody>主文本</CellBody>
<CellFooter>
次文本
<img src={iconSrc} alt="" style={cellFooterIconStyle} />
</CellFooter>
</Cell>
<Cell list>
<CellBody>主文本</CellBody>
<CellFooter>
次文本
<img src={iconSrc} alt="" style={cellFooterIconStyle} />
</CellFooter>
</Cell>
</Cells>
<CellsTitle>操作性图标+主文本</CellsTitle>
<Cells>
<Cell list icon>
<CellHeader>
<img src={iconSrc} alt="" style={cellHeaderStyle} />
</CellHeader>
<CellBody>主文本</CellBody>
</Cell>
<Cell list icon>
<CellHeader>
<img src={iconSrc} alt="" style={cellHeaderStyle} />
</CellHeader>
<CellBody>主文本</CellBody>
</Cell>
</Cells>
<CellsTitle>主文本+次文本(可选)+提示性图标</CellsTitle>
<Cells>
<Cell list icon>
<CellHeader>
<img src={iconSrc} alt="" style={cellHeaderStyle} />
</CellHeader>
<CellBody>主文本</CellBody>
<CellFooter>
<img src={iconSrc} alt="" style={cellFooterIconStyle} />
</CellFooter>
</Cell>
<Cell list icon>
<CellHeader>
<img src={iconSrc} alt="" style={cellHeaderStyle} />
</CellHeader>
<CellBody>主文本</CellBody>
<CellFooter>
<img src={iconSrc} alt="" style={cellFooterIconStyle} />
</CellFooter>
</Cell>
</Cells>
<CellsTitle>图文列表</CellsTitle>
<Cells>
<Cell image>
<CellHeader>
<CellHeaderImage src={iconSrc} />
</CellHeader>
<CellBody>相机胶卷(2023)</CellBody>
<CellFooter />
</Cell>
<Cell image>
<CellHeader>
<CellHeaderImage src={iconSrc} />
</CellHeader>
<CellBody>相机胶卷(2023)</CellBody>
<CellFooter />
</Cell>
</Cells>
<Cells>
<Cell list round>
<CellHeader>
<CellHeaderImage src={iconSrc} />
</CellHeader>
<CellBody>
主文本<CellBodySubText>次文本</CellBodySubText>
<CellBodyExplan>辅助说明文体</CellBodyExplan>
</CellBody>
<CellFooter />
</Cell>
</Cells>
<Cells>
<Cell square>
<CellHeader>
<CellHeaderImage src={iconSrc} />
</CellHeader>
<CellBody>
主文本
<CellBodyExplan>辅助说明文体</CellBodyExplan>
</CellBody>
<CellFooter />
</Cell>
</Cells>
<Cells>
<Cell icon>
<CellHeader>
<CellHeaderImage src={iconSrc} />
</CellHeader>
<CellBody />
<CellFooter>
<CellFooterImage src={iconSrc} />
</CellFooter>
</Cell>
</Cells>
</div>
);
export default ListDemo;
- 点赞
- 收藏
- 关注作者
评论(0)