rank.vue
1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<template>
<div class="detailRankPage">
<div class="top">
<div class="text">{{ title }}</div>
<div class="text">{{ subtitle }}</div>
</div>
<section>
<div v-for="(item,index) in rankData" :key="index">
<div v-if="index < 10" class="list">
<span class="icon" :class="[index <= 2 ? 'spanAct' : '']">{{ index+1 }}</span>
<span>{{ item.rankName }}</span>
<span>{{ item.ranks }}</span>
</div>
</div>
</section>
</div>
</template>
<script>
export default {
props: {
title: {
type: String,
default: ''
},
subtitle: {
type: String,
default: ''
},
rankData: {
type: Array,
default: () => []
}
}
}
</script>
<style scoped lang="scss">
.detailRankPage{
margin-left: 20px;
width: 100%;
height: 100%;
padding: 20px 12px;
background: #ffffff;
border: 1px solid #efefef;
border-radius: 4px;
.top {
width: 100%;
display: flex;
justify-content: space-between;
.text {
font-size: 18px;
color: #333333;
}
}
section {
width: 100%;
.list {
margin-top: 20px;
display: flex;
justify-content: space-between;
align-items: center;
span {
color: #666666;
}
.icon{
margin-left: 5px;
}
.spanAct {
background-color: #ff7911 !important;
color: #ffffff !important;
}
span:nth-child(1) {
$height: 26px;
width: 26px;
height: $height;
line-height: $height;
text-align: center;
background-color: #dddddd;
border-radius: 50%;
}
span:nth-child(2) {
flex: 8;
margin: 0 8px;
}
span:nth-child(3) {
flex: 1;
}
}
}
}
</style>