Welink React-ui表单组件List

举报
云会议运营喵大人 发表于 2020/02/21 18:11:12 2020/02/21
【摘要】 ListList(双行) UI 提供与WeLink规范一致的视图,包含:带说明跳转参数说明Cell名称类型默认值说明accessboolfalse是否需要箭头listboolfalse是否需要内部上下间距格式componentfunc传递组件替换单元格linkboolfalse是否为连接CellHeader、CellBody、CellFooter参数类型默认值说明primaryboolfal...

List


List(双行) UI 提供与WeLink规范一致的视图,包含:

  • 带说明跳转

参数说明

Cell

名称类型默认值说明
accessboolfalse是否需要箭头
listboolfalse是否需要内部上下间距格式
componentfunc
传递组件替换单元格
linkboolfalse是否为连接

CellHeader、CellBody、CellFooter

参数类型默认值说明
primaryboolfalse是否为主模块

import React from 'react';
import {
  Cells, Cell, CellBody, CellBodyExplan, CellFooter
} from '@wecode/react-weui';

const iconBase64 = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAACgCAIAAAAErfB6AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Im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Tl/M/tOvB+pEWedrveDXWvjWlJ8sffTX57qKBgQDggHBCAYEA4IBwYBgQDAgGBCMYEAwIBgQDAgGBAOCEQwIBgQDggHBgGBAMCAYwYBgQDAgGBAMCAYEIxgQDAgGBAOCAcGAYAQDggHBgGBAMCAYEAwIRjAgGBAMCAYEA4IBwQgGBAOCAcGAYEAwIBjBgGBAMCAYPp//BBgAStflVPGsRa8AAAAASUVORK5CYII=';

const cellFooterStyle = {
  display: 'inline-block',
  width: '16px',
  marginLeft: '12px',
  verticalAlign: 'middle'
};

const cellBodyPStyle = { lineHeight: 1.5 };

const ListDemo = props => (
  <section>
    <Cells>
      <Cell list>
        <CellBody>
          <p style={cellBodyPStyle}>
            主文本,文本较多换行时,列表高度相应增高,文本与列表上下间距不变
          </p>
          <CellBodyExplan>此处是辅助说明文体,说明文本</CellBodyExplan>
        </CellBody>
        <CellFooter>
          <img src={iconBase64} alt="" style={cellFooterStyle} />
        </CellFooter>
      </Cell>
      <Cell list>
        <CellBody>
          主文本
          <CellBodyExplan>
            此处是辅助说明文体,说明文本,文本较多换行时,列表高度相应增高,文本与列表上下间距不变
          </CellBodyExplan>
        </CellBody>
        <CellFooter>
          <img src={iconBase64} alt="" style={cellFooterStyle} />
        </CellFooter>
      </Cell>
    </Cells>
  </section>
);

export default ListDemo;


【版权声明】本文为华为云社区用户原创内容,未经允许不得转载,如需转载请自行联系原作者进行授权。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@huaweicloud.com
  • 点赞
  • 收藏
  • 关注作者

评论(0

0/1000
抱歉,系统识别当前为高风险访问,暂不支持该操作

全部回复

上滑加载中

设置昵称

在此一键设置昵称,即可参与社区互动!

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。