Unverified Commit d6b23f39 by Sendya

refactor: chart-card api

parent dbdebca1
...@@ -2,12 +2,20 @@ ...@@ -2,12 +2,20 @@
<a-card :loading="loading" :body-style="{ padding: '20px 24px 8px' }" :bordered="false"> <a-card :loading="loading" :body-style="{ padding: '20px 24px 8px' }" :bordered="false">
<div class="chart-card-header"> <div class="chart-card-header">
<div class="meta"> <div class="meta">
<span class="chart-card-title">{{ title }}</span> <span class="chart-card-title">
<slot name="title">
{{ title }}
</slot>
</span>
<span class="chart-card-action"> <span class="chart-card-action">
<slot name="action"></slot> <slot name="action"></slot>
</span> </span>
</div> </div>
<div class="total"><span>{{ total }}</span></div> <div class="total">
<slot name="total">
<span>{{ typeof total === 'function' && total() || total }}</span>
</slot>
</div>
</div> </div>
<div class="chart-card-content"> <div class="chart-card-content">
<div class="content-fix"> <div class="content-fix">
...@@ -31,8 +39,9 @@ export default { ...@@ -31,8 +39,9 @@ export default {
default: '' default: ''
}, },
total: { total: {
type: String, type: [Function, Number, String],
default: '' required: false,
default: null
}, },
loading: { loading: {
type: Boolean, type: Boolean,
...@@ -108,4 +117,4 @@ export default { ...@@ -108,4 +117,4 @@ export default {
line-height: 38px; line-height: 38px;
height: 38px; height: 38px;
} }
</style> </style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment