Blame view

ant-design-vue-jeecg/src/components/NumberInfo/NumberInfo.vue 963 Bytes
肖超群 authored
1
2
3
4
5
6
7
8
9
<template>
  <div :class="[prefixCls]">
    <slot name="subtitle">
      <div :class="[`${prefixCls}-subtitle`]">{{ typeof subTitle === 'string' ? subTitle : subTitle() }}</div>
    </slot>
    <div class="number-info-value">
      <span>{{ total }}</span>
      <span class="sub-total">
        {{ subTotal }}
肖超群 authored
10
        <icon :type="`caret-${status}`"/>
肖超群 authored
11
12
13
14
15
16
      </span>
    </div>
  </div>
</template>

<script>
肖超群 authored
17
import Icon from 'ant-design-vue/es/icon'
肖超群 authored
18
肖超群 authored
19
20
21
22
23
24
export default {
  name: 'NumberInfo',
  props: {
    prefixCls: {
      type: String,
      default: 'ant-pro-number-info'
肖超群 authored
25
    },
肖超群 authored
26
27
28
    total: {
      type: Number,
      required: true
肖超群 authored
29
    },
肖超群 authored
30
31
32
33
34
35
36
37
38
39
40
    subTotal: {
      type: Number,
      required: true
    },
    subTitle: {
      type: [String, Function],
      default: ''
    },
    status: {
      type: String,
      default: 'up'
肖超群 authored
41
    }
肖超群 authored
42
43
44
45
46
47
  },
  components: {
    Icon
  },
  data() {
    return {}
肖超群 authored
48
  }
肖超群 authored
49
}
肖超群 authored
50
51
</script>
52
<style lang="less">
肖超群 authored
53
@import "index";
肖超群 authored
54
</style>