前端项目实战234-ant design table总结栏

 summary={(data) => {
              let totalCount = 0;
              data.forEach((item: any) => {
                if (item.styleId == getStyle) {
                  totalCount += parseInt(item.count);
                }
              });
              return (
                <>
                  <Table.Summary.Row>
                    <Table.Summary.Cell index={0}>合计</Table.Summary.Cell>
                    <Table.Summary.Cell index={1}></Table.Summary.Cell>
                    <Table.Summary.Cell index={2}></Table.Summary.Cell>
                    <Table.Summary.Cell index={3}>
                      <span>{totalCount}</span>
                    </Table.Summary.Cell>
                  </Table.Summary.Row>
                </>
              );
            }}

posted @ 2022-12-23 10:10  前端导师歌谣  阅读(109)  评论(0)    收藏  举报