All files / src/list/_example ListExample.jsx

100% Statements 2/2
100% Branches 0/0
100% Functions 2/2
100% Lines 2/2

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73          6x       1x                                                                                                                              
import React from "react";
import { List } from "@tencent/tea-component/lib/list";
import { Row, Col } from "@tencent/tea-component/lib/grid";
 
function Title({ children }) {
  return <h4 style={{ margin: "20px 0" }}>{children}</h4>;
}
 
export default function ListExample() {
  return (
    <>
      <Row>
        <Col>
          <Title>普通列表</Title>
          <List>
            <List.Item>打开冰箱</List.Item>
            <List.Item>把大象放到冰箱里</List.Item>
            <List.Item>关闭冰箱门</List.Item>
          </List>
        </Col>
        <Col>
          <Title>无序列表</Title>
          <List type="bullet">
            <List.Item>打开冰箱</List.Item>
            <List.Item>把大象放到冰箱里</List.Item>
            <List.Item>关闭冰箱门</List.Item>
          </List>
        </Col>
        <Col>
          <Title>有序列表</Title>
          <List type="number">
            <List.Item>打开冰箱</List.Item>
            <List.Item>把大象放到冰箱里</List.Item>
            <List.Item>关闭冰箱门</List.Item>
          </List>
        </Col>
      </Row>
      <Row>
        <Col>
          <Title>分割线</Title>
          <List split="divide">
            <List.Item>打开冰箱</List.Item>
            <List.Item>把大象放到冰箱里</List.Item>
            <List.Item>关闭冰箱门</List.Item>
          </List>
        </Col>
        <Col>
          <Title>分割条纹</Title>
          <List split="stripe">
            <List.Item>打开冰箱</List.Item>
            <List.Item>把大象放到冰箱里</List.Item>
            <List.Item>关闭冰箱门</List.Item>
          </List>
        </Col>
        <Col>
          <Title>列表嵌套</Title>
          <List type="number">
            <List.Item>
              打开冰箱
              <List type="bullet">
                <List.Item>西门子冰箱</List.Item>
                <List.Item>双手打开</List.Item>
              </List>
            </List.Item>
            <List.Item>把大象放到冰箱里</List.Item>
            <List.Item>关闭冰箱门</List.Item>
          </List>
        </Col>
      </Row>
    </>
  );
}