当前位置:网站首页>Custom vertical table
Custom vertical table
2022-06-25 13:16:00 【liminla!】
design sketch :

Code :
<template>
<div class="mesTable">
<div class="table">
<div
class="tr"
v-for="(item, index) in tableData"
:key="index"
:class="[item.line ? 'one' : 'two']"
>
<div class="th" :class="{ nodata: !item.value }">
<span>{
{
item.title }}</span>
</div>
<div class="td" :class="{ nodata: !item.value }">
<img
v-if="item.isIcon && item.value != '--'"
width="52"
:src="item.value"
/>
<a
v-else-if="item.isUrl && item.value != '--'"
:href="item.value"
target="_blank"
>{
{
item.value }}</a
>
<p v-else>{
{
item.value }}</p>
</div>
</div>
<Loading v-if="isLoading"></Loading>
</div>
</div>
</template>
<script>
export default {
props: {
tableData: {
type: Array,
default: () => [
{
title: "",
value: "",
line: "",
isUrl: false,
isIcon: false,
},
],
},
},
data() {
return {
isLoading: false,
};
},
watch: {
tableData: {
handler(val) {
if (val.length) {
this.isLoading = false;
} else {
this.isLoading = true;
}
},
deep: true,
},
},
mounted() {
},
methods: {
},
};
</script>
<style lang="less" scoped>
.mesTable {
background: #fff;
.table {
border: 1px solid #dee9ff;
display: flex;
flex-wrap: wrap;
font-size: 14px;
font-family: MicrosoftYaHeiUI;
.tr {
display: flex;
// flex-wrap: wrap;
align-items: center;
font-size: 14px;
line-height: 20px;
background: rgba(84, 174, 255, 0.1);
&.one {
width: 100%;
}
&.two {
width: 50%;
}
&:not(:last-child) {
border-bottom: 1px solid #dee9ff;
}
.one {
width: 100%;
display: flex;
align-items: center;
}
.two {
width: 50%;
display: flex;
align-items: center;
}
.th {
width: 210px;
color: #677380;
display: flex;
align-items: center;
padding: 12px 0 12px 20px;
height: 100%;
word-break: break-all;
&:not(:last-child) {
border-right: 1px solid #dee9ff;
}
}
.nodata {
height: 48px;
}
.td {
display: flex;
align-items: center;
height: 100%;
background: #fff;
padding: 12px 20px 12px 20px;
flex: 1;
color: #333333;
word-break: break-all;
a {
color: #1492ff;
}
&:not(:last-child) {
border-right: 1px solid #dee9ff;
}
}
}
}
}
</style>
边栏推荐
- Sword finger offer II 032 Effective anagrams
- And console Log say goodbye
- Germany holds global food security Solidarity Conference
- 数据在内存中的存储相关内容
- 剑指 Offer II 028. 展平多级双向链表
- golang键盘输入语句scanln scanf代码示例
- WIN10环境下配置pytorch
- KVM script management - the road to dream
- 关于数据在内存中的存储下
- Three lines of code to simply modify the project code of the jar package
猜你喜欢

Shenzhen mintai'an intelligent second side_ The first offer of autumn recruitment

An article clearly explains MySQL's clustering / Federation / coverage index, back to table, and index push down

剑指Offer 第 2 天链表(简单)

出手即不凡,这很 Oracle!

药物设计新福音:腾讯联合中科大、浙大开发自适应图学习方法,预测分子相互作用及分子性质

关于结构体,枚举,联合的一些知识
![[flask tutorial] flask development foundation and introduction](/img/c4/fb80fbe6b563e3b304d59623ef6465.jpg)
[flask tutorial] flask development foundation and introduction

About data storage in memory

Common colors for drawing

Sword finger offer II 029 Sorted circular linked list
随机推荐
爱可可AI前沿推介(6.25)
[pit avoidance refers to "difficult"] halfcheckedkeys rendering problem in semi selected status of antd tree
ByteDance dev better technology salon is coming! Participate in the activity to win a good gift, and sign up for free within a limited time!
Pointer, it has to say that the subject
Oral English - continuous reading
出手即不凡,这很 Oracle!
MySQL 学习笔记
Of binary tree_ Huffman tree_ Huffman encoding
KVM script management - the road to dream
Sword finger offer II 025 Adding two numbers in a linked list
Serevlt初识
原生js---无限滚动
剑指 Offer II 029. 排序的循环链表
Koa frame
QT mouse tracking
Back test of quantitative trading - tqzfuturerenkowavestrategy
Maui的学习之路(二)--设置
Some knowledge about structure, enumeration and union
QT display ffmpeg decoded pictures
Heavyweight live | bizdevops: the way to break the technology situation under the tide of digital transformation