commit | author | age
|
9bcb19
|
1 |
<template> |
I |
2 |
<div :class="[prefixCls]"> |
|
3 |
<slot name="subtitle"> |
|
4 |
<div :class="[`${prefixCls}-subtitle`]">{{ typeof subTitle === 'string' ? subTitle : subTitle() }}</div> |
|
5 |
</slot> |
|
6 |
<div class="number-info-value"> |
|
7 |
<span>{{ total }}</span> |
|
8 |
<span class="sub-total"> |
|
9 |
{{ subTotal }} |
|
10 |
<icon :type="`caret-${status}`" /> |
|
11 |
</span> |
|
12 |
</div> |
|
13 |
</div> |
|
14 |
</template> |
|
15 |
|
|
16 |
<script> |
|
17 |
import Icon from 'ant-design-vue/es/icon' |
|
18 |
|
|
19 |
export default { |
|
20 |
name: 'NumberInfo', |
|
21 |
props: { |
|
22 |
prefixCls: { |
|
23 |
type: String, |
|
24 |
default: 'ant-pro-number-info' |
|
25 |
}, |
|
26 |
total: { |
|
27 |
type: Number, |
|
28 |
required: true |
|
29 |
}, |
|
30 |
subTotal: { |
|
31 |
type: Number, |
|
32 |
required: true |
|
33 |
}, |
|
34 |
subTitle: { |
|
35 |
type: [String, Function], |
|
36 |
default: '' |
|
37 |
}, |
|
38 |
status: { |
|
39 |
type: String, |
|
40 |
default: 'up' |
|
41 |
} |
|
42 |
}, |
|
43 |
components: { |
|
44 |
Icon |
|
45 |
}, |
|
46 |
data () { |
|
47 |
return {} |
|
48 |
} |
|
49 |
} |
|
50 |
</script> |
|
51 |
|
|
52 |
<style lang="less" scoped> |
|
53 |
@import "index"; |
|
54 |
</style> |