93 lines
1.5 KiB
Vue
93 lines
1.5 KiB
Vue
<template>
|
|
<div class="summary6">
|
|
<div class="summary6-item" v-for="(item, index) in data" :key="index" v-if="index < 4">
|
|
<div class="left">
|
|
</div>
|
|
<div class="right">
|
|
<h2>{{ item[keys] }}</h2>
|
|
<p>{{ item[value] }}</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
name: 'summary6',
|
|
|
|
props: {
|
|
data: {
|
|
type: Array,
|
|
default: () => []
|
|
},
|
|
|
|
keys: {
|
|
type: String,
|
|
default: 'key'
|
|
},
|
|
|
|
value: {
|
|
type: String,
|
|
default: 'value'
|
|
}
|
|
},
|
|
|
|
data () {
|
|
return {
|
|
}
|
|
},
|
|
|
|
methods: {
|
|
getImg (index) {
|
|
return {
|
|
'0': this.img1,
|
|
'1': this.img2,
|
|
'2': this.img3,
|
|
'3': this.img4
|
|
}[index]
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
.summary6 {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
width: 100%;
|
|
height: 100%;
|
|
|
|
div {
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
.summary6-item {
|
|
display: flex;
|
|
position: relative;
|
|
align-items: center;
|
|
|
|
.left {
|
|
display: flex;
|
|
position: relative;
|
|
align-items: center;
|
|
justify-content: center;
|
|
}
|
|
|
|
h2 {
|
|
line-height: 24px;
|
|
color: #fff;
|
|
font-size: 16px;
|
|
font-weight: normal;
|
|
}
|
|
|
|
p {
|
|
font-size: 28px;
|
|
color: #fff;
|
|
font-weight: 700;
|
|
}
|
|
}
|
|
}
|
|
</style>
|