File tree Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Original file line number Diff line number Diff line change 2
2
<a-card :loading =" loading" :body-style =" { padding: '20px 24px 8px' }" :bordered =" false" >
3
3
<div class =" chart-card-header" >
4
4
<div class =" meta" >
5
- <span class =" chart-card-title" >{{ title }}</span >
5
+ <span class =" chart-card-title" >
6
+ <slot name =" title" >
7
+ {{ title }}
8
+ </slot >
9
+ </span >
6
10
<span class =" chart-card-action" >
7
11
<slot name =" action" ></slot >
8
12
</span >
9
13
</div >
10
- <div class =" total" ><span >{{ total }}</span ></div >
14
+ <div class =" total" >
15
+ <slot name =" total" >
16
+ <span >{{ typeof total === 'function' && total() || total }}</span >
17
+ </slot >
18
+ </div >
11
19
</div >
12
20
<div class =" chart-card-content" >
13
21
<div class =" content-fix" >
@@ -31,8 +39,9 @@ export default {
31
39
default: ' '
32
40
},
33
41
total: {
34
- type: String ,
35
- default: ' '
42
+ type: [Function , Number , String ],
43
+ required: false ,
44
+ default: null
36
45
},
37
46
loading: {
38
47
type: Boolean ,
@@ -108,4 +117,4 @@ export default {
108
117
line-height : 38px ;
109
118
height : 38px ;
110
119
}
111
- </style >
120
+ </style >
You can’t perform that action at this time.
0 commit comments