|
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 }}
|
|
10
|
<icon :type="`caret-${status}`"/>
|
|
11
12
13
14
15
16
|
</span>
</div>
</div>
</template>
<script>
|
|
17
|
import Icon from 'ant-design-vue/es/icon'
|
|
18
|
|
|
19
20
21
22
23
24
|
export default {
name: 'NumberInfo',
props: {
prefixCls: {
type: String,
default: 'ant-pro-number-info'
|
|
25
|
},
|
|
26
27
28
|
total: {
type: Number,
required: true
|
|
29
|
},
|
|
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'
|
|
41
|
}
|
|
42
43
44
45
46
47
|
},
components: {
Icon
},
data() {
return {}
|
|
48
|
}
|
|
49
|
}
|
|
50
51
|
</script>
|
|
52
|
<style lang="less">
|
|
53
|
@import "index";
|
|
54
|
</style>
|