Blame view

ant-design-vue-jeecg/src/components/chart/RankList.vue 1.46 KB
肖超群 authored
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<template>
  <div class="rank">
    <h4 class="title">{{ title }}</h4>
    <ul class="list" :style="{height:height?`${height}px`:'auto',overflow:'auto'}">
      <li :key="index" v-for="(item, index) in list">
        <span :class="index < 3 ? 'active' : null">{{ index + 1 }}</span>
        <span>{{ item.name }}</span>
        <span>{{ item.total }}</span>
      </li>
    </ul>
  </div>
</template>

<script>
肖超群 authored
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
export default {
  name: "RankList",
  // ['title', 'list']
  props: {
    title: {
      type: String,
      default: ''
    },
    list: {
      type: Array,
      default: null
    },
    height: {
      type: Number,
      default: null
肖超群 authored
30
31
    }
  }
肖超群 authored
32
}
肖超群 authored
33
34
35
36
</script>

<style lang="less" scoped>
肖超群 authored
37
38
39
40
41
42
43
44
45
46
.rank {
  padding: 0 32px 32px 72px;

  .list {
    margin: 25px 0 0;
    padding: 0;
    list-style: none;

    li {
      margin-top: 16px;
肖超群 authored
47
肖超群 authored
48
49
50
51
      span {
        color: rgba(0, 0, 0, .65);
        font-size: 14px;
        line-height: 22px;
肖超群 authored
52
肖超群 authored
53
54
55
56
57
58
59
60
61
62
63
64
        &:first-child {
          background-color: #f5f5f5;
          border-radius: 20px;
          display: inline-block;
          font-size: 12px;
          font-weight: 600;
          margin-right: 24px;
          height: 20px;
          line-height: 20px;
          width: 20px;
          text-align: center;
        }
肖超群 authored
65
肖超群 authored
66
67
68
69
        &.active {
          background-color: #314659;
          color: #fff;
        }
肖超群 authored
70
肖超群 authored
71
72
        &:last-child {
          float: right;
肖超群 authored
73
74
75
76
        }
      }
    }
  }
肖超群 authored
77
}
肖超群 authored
78
肖超群 authored
79
80
81
.mobile .rank {
  padding: 0 32px 32px 32px;
}
肖超群 authored
82
83

</style>