javascript - 如何使用 React js 在 ant 设计的网格中添加卡片
问题描述
什么是蚂蚁设计?具有自然和确定性价值的设计系统,可提供更好的企业应用程序用户体验阅读更多>> https://ant.design/
卡片可用于显示与单个主题相关的内容。内容可以由不同类型和大小的多个元素组成。如果您需要在网格系统中添加卡试试这个
在这里,我使用 3 Grid in row(您可以根据您的要求进行更改)。
代码:
import React from 'react';
import { Card, Icon, Avatar } from 'antd';
const { Meta } = Card;
import { Row, Col } from 'antd';
class Surveys extends React.Component{
render() {
return (
<Row gutter={16}>
<Col className="gutter-row" span={8}>
<Card
cover={<img alt="example" src="https://gw.alipayobjects.com/zos/rmsportal/JiqGstEfoWAOHiTxclqi.png" />}
actions={[<Icon type="setting" />, <Icon type="edit" />, <Icon type="ellipsis" />]}
>
<Meta
avatar={<Avatar src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png" />}
title="Card title"
description="This is the description"
/>
</Card>
</Col>
<Col className="gutter-row" span={8}>
<Card
cover={<img alt="example" src="https://gw.alipayobjects.com/zos/rmsportal/JiqGstEfoWAOHiTxclqi.png" />}
actions={[<Icon type="setting" />, <Icon type="edit" />, <Icon type="ellipsis" />]}
>
<Meta
avatar={<Avatar src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png" />}
title="Card title"
description="This is the description"
/>
</Card>
</Col>
<Col className="gutter-row" span={8}>
<Card
cover={<img alt="example" src="https://gw.alipayobjects.com/zos/rmsportal/JiqGstEfoWAOHiTxclqi.png" />}
actions={[<Icon type="setting" />, <Icon type="edit" />, <Icon type="ellipsis" />]}
>
<Meta
avatar={<Avatar src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png" />}
title="Card title"
description="This is the description"
/>
</Card>
</Col>
</Row>
);
}
}
export default Surveys;
解决方案
推荐阅读
- python - 从另一个指定矩阵更改矩阵的第一列
- asp.net - 在 Plesk (GoDaddy) 中部署 ASP.Net 网站和 REST Web 服务
- python - 关闭pycharm容器的正确方法
- javascript - 用javascript中的值替换模式
- python - “模块”的实例没有“LBPHFaceRecognizer_create”成员
- .htaccess - 301将子目录中的www和其他子域重定向到非www
- c - 如果该结构作为数组存在,是否可以只从结构中发送一个变量?
- java - 如何使用不是变量的返回值
- wpf - 如何解决xaml中动画和属性绑定冲突的问题
- asp.net-core - 在添加新项目对话框与 2017 中找不到 SignalR Hub 类