首页 > 其他分享 >时间轴组件,数据展示为卡片形式

时间轴组件,数据展示为卡片形式

时间:2023-09-26 13:34:13浏览次数:30  
标签:16px 卡片 color height 时间轴 组件 position line margin

```javascript
import React, { useState } from 'react';
import styles from '@/styles/portrait/TrafficAdministrativeCases.module.less'


const Left: React.FC = ({ }) => {
return (
<div className={styles.left}>
<div className={styles.unknow}>22</div>
<div className={styles.leftSJ}>2022-02</div>
</div>
);
};

const Middle: React.FC = ({ }) => {
return (
<div className={styles.middle}>
<div className={styles.big}>
<div className={styles.small}></div>
</div>
<div className={styles.line}></div>
</div>
);
};

const Card: React.FC = ({ }) => {
return (
<div className={styles.card}>
<div className={styles.firstRow}>
{/* */}
<div className={styles.xq}>aaa</div>
{/* */}
<div className={styles.sj}>bbb4</div>
</div>
<div className={styles.secondRow}>
{/* */}
<div className={styles.dz}>ccc</div>
{/* */}
<div className={styles.cf}>ddd</div>
</div>
</div>
);
};

const App: React.FC = () => {
const traffic = []

return (
<div style={{ overflowY: 'auto' }} className={styles.traffic}>
<div className={styles.item}>
<Left />
<Middle />
<Card />
</div>
<div className={styles.item}>
<Left />
<Middle />
<Card />
</div>
<div className={styles.item}>
<Left />
<Middle />
<Card />
</div>
</div>
);
};

export default App;

```


```less
.traffic {
margin: 0;
padding: 0;
margin-top: 10px;
width: 716px;
height: 243px;
overflow-y: visible;

.item {
position: relative;
margin-bottom: 24px;
height: 82px;

.left {
position: absolute;
top: 10px;
left: 0;
width: 65px;
height: 42px;

// background-color: #1990ff;
.unknow {
font-size: 14px;
line-height: 14px;
margin-bottom: 16px;
}

.leftSJ {
font-size: 12px;
line-height: 12px;
color: #a6b4c3;
}
}

.middle {
position: absolute;
top: 34px;
left: 95px;
display: flex;
flex-direction: column;
align-items: center;
width: 12px;

.big {
margin-bottom: 4px;
padding: 4px;
width: 12px;
height: 12px;
border-radius: 6px;
background-color: #1990ff;

.small {
width: 4px;
height: 4px;
border-radius: 2px;
background-color: #fff;
}
}

.line {
border-left: 2px dashed #a6b4c3;
height: 78px;
//line-height:1px;
}
}

.card {
position: absolute;
top: 0;
right: 0;
width: 572px;
height: 82px;
background-color: #f4f7fb;

.firstRow {
position: relative;
margin-top: 20px;
margin-left: 16px;
margin-bottom: 11px;
height: 20px;

.xq {
position: absolute;
left: 0;
font-size: 20px;
line-height: 20px;
color: #333;
}

.sj {
position: absolute;
top: 8px;
right: 16px;
font-size: 12px;
line-height: 20px;
color: #a6b4c3;
}
}

.secondRow {
position: relative;
margin-left: 16px;

.dz {
position: absolute;
left: 0;
font-size: 16px;
line-height: 16px;
color: #a6b4c3;
}

.cf {
position: absolute;
right: 16px;
font-size: 16px;
line-height: 16px;
color: #1990ff;
}
}
}
}

.item:last-child {
margin-bottom: 0;
.line {
display: none;
}
}

}
```

标签:16px,卡片,color,height,时间轴,组件,position,line,margin
From: https://www.cnblogs.com/yxxcl51/p/17729886.html

相关文章

  • Vue3 组件基础:轻松掌握前端开发新技能!
    基本实例这里有一个Vue组件的示例://创建一个Vue应用constapp=Vue.createApp({})//定义一个名为button-counter的新全局组件app.component('button-counter',{data(){return{count:0}},template:`<button@click="count++">......
  • drf(视图组件)
    一.前言DjangoRESTframwork提供的视图的主要作用1.控制序列化器的执行(检验、保存、转换数据)2.控制数据库查询的执行二.两个视图基类两个视图基类:APIView,GenericAPIView1.APIView继承django原生View,重写方法,去掉csrf验证,用自己的dispatchmodels.pyclassB......
  • 前端组件通信工具-自定义Bus
    前端组件通信工具-自定义Bus在utils添加Bus//先定义一个类型,emit作为发布(传递),on作为订阅(接收)//name是事件名称,callback是一个回调函数typeBusClass={emit:(name:string)=>voidon:(name:string,callback:Function)=>voidoff:(name:string)=>voi......
  • 界面组件DevExpress VCL v23.2新功能预览 - 支持Windows 11
    距离DevExpressVCL 下一个主要更新(v23.2)还有几个月的时间,本文将为大家描述预计在12月初为激活的DevExpressVCL用户发布的一些功能。正如你将在下面看到的,重点领域将继续保持高DPI/SVG和Windows11的支持。DevExpressVCL所包含的控件有:数据录入、图表、数据分析、导航、布局......
  • 4.操作卡片和OBU的指令以及流程
     用户卡认证命令流1、获取随机数:00840000042、进入1001目录:00A400000210013、读15文件:00B095002B4、计算mac:00880201+10(1字节数据长度)+16字节摘要码操作IC卡片(读15文件,卡基本信息)1、选1001:00A400000210012、读15文件:00B095002B操作IC卡片(写15文件,卡基......
  • Hadoop是什么? Hadoop是一个由Apache开发的开源分布式计算框架,它能够处理大规模数据并
    Hadoop是什么?Hadoop是一个由Apache开发的开源分布式计算框架,它能够处理大规模数据并行处理任务,支持大规模数据存储和处理。Hadoop的核心组件包括分布式文件系统HDFS和分布式计算框架MapReduce,它们使得Hadoop可以在廉价的硬件上并行地处理大量数据。Hadoop还包括很多相关的项目和子......
  • 使用Vue3+elementPlus的Tree组件实现一个拖拽文件夹管理
    目录1、前言2、分析3、实现4、踩坑4.1、拖拽辅助线的坑4.2、数据的坑4.3、限制拖拽4.4、样式调整1、前言最近在做一个文件夹管理的功能,要实现一个树状的文件夹面板。里面包含两种元素,文件夹以及文件。交互要求如下:创建、删除,重命名文件夹和文件可以拖拽,拖拽文件到文件夹中,或......
  • uni 组件自带方法怎么传自定义参数下去
    html<pickermode="selector"class="pickers"@change="PickerLittleChange($event,operatingState)" :value="indexs"range-key="dictLabel":range="operatingState"> <viewclas......
  • OpenHarmony自定义组件介绍
     一、创建自定义组件在ArkUI中,UI显示的内容均为组件,由框架直接提供的称为系统组件,由开发者定义的称为自定义组件。在进行 UI 界面开发时,通常不是简单的将系统组件进行组合使用,而是需要考虑代码可复用性、业务逻辑与UI分离,后续版本演进等因素。因此,将UI和部分业务逻辑封装成......
  • OpenHarmony自定义组件介绍
    一、创建自定义组件在ArkUI中,UI显示的内容均为组件,由框架直接提供的称为系统组件,由开发者定义的称为自定义组件。在进行UI界面开发时,通常不是简单的将系统组件进行组合使用,而是需要考虑代码可复用性、业务逻辑与UI分离,后续版本演进等因素。因此,将UI和部分业务逻辑封装成自定义组......