当前位置:网站首页>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>
边栏推荐
- 买基金在哪里开户安全?还请赐教
- 关于一道教材题的讲解
- 二叉树之_哈夫曼树_哈弗曼编码
- Which Chinese virtual human is better? Sullivan, IDC: Xiaobing Baidu Shangtang ranks in the first echelon
- À propos du stockage des données en mémoire
- Used in time filter (EL table)
- Online service emergency research methodology
- Storage related contents of data in memory
- 剑指 Offer 第 1 天栈与队列(简单)
- Resolved: could not find artifact XXX
猜你喜欢
The editor is used every day. What is the working principle of language service protocol?
1251- client does not support authentication protocol MySQL error resolution
Update PIP & Download jupyter Lab
剑指Offer 第 2 天链表(简单)
My first experience of go+ language -- a collection of notes on learning go+ design architecture
Koa frame
关于三子棋游戏的简易实现与N子棋胜利判断方法
Seven competencies required by architects
Summer Ending
解析數倉lazyagg查詢重寫優化
随机推荐
Sword finger offer II 032 Effective anagrams
@Scheduled implementation of scheduled tasks (concurrent execution of multiple scheduled tasks)
LeetCode链表题解技巧归纳总结
Oracle backup or restore database (expdp, impdp)
Using CMD (command prompt) to install MySQL & configure the environment
出手即不凡,这很 Oracle!
torch. Tensor splicing and list (tensors)
Koa frame
About data storage in memory
[flask tutorial] flask development foundation and introduction
字节跳动Dev Better技术沙龙来啦!参与活动赢好礼,限时免费报名中!
Lexical trap
剑指 Offer II 032. 有效的变位词
Qt鼠标跟踪
Jenkins pipeline uses
Storage related contents of data in memory
C# 切换中英文输入法
Update PIP & Download jupyter Lab
Oral English - continuous reading
golang键盘输入语句scanln scanf代码示例