@@ -4,6 +4,11 @@ import { Color } from '../props'
44import { CCard , CCardBody , CCardHeader } from './../card/'
55import { CCol } from './../grid/'
66
7+ type Value = {
8+ title ?: string
9+ value ?: number | string
10+ }
11+
712const CWidgetStatsD = defineComponent ( {
813 name : 'CWidgetStatsD' ,
914 props : {
@@ -17,12 +22,12 @@ const CWidgetStatsD = defineComponent({
1722 * Values and titles for your component.
1823 */
1924 values : {
20- type : Array as PropType < number [ ] | string [ ] > ,
25+ type : Array as PropType < Value [ ] > ,
2126 default : ( ) => [ ] ,
2227 require : false ,
2328 } ,
2429 } ,
25- /**
30+ /**
2631 * Location for icon component, ex. `<CDropdown>`.
2732 *
2833 * @slot icon
@@ -59,18 +64,18 @@ const CWidgetStatsD = defineComponent({
5964 {
6065 default : ( ) =>
6166 props . values &&
62- props . values . map ( ( value : number | string , index : number ) => [
67+ props . values . map ( ( value : Value , index : number ) => [
6368 index % 2 !== 0 && h ( 'div' , { class : 'vr' } ) ,
6469 h (
6570 CCol ,
6671 { } ,
6772 {
6873 default : ( ) => [
69- h ( CCol , { class : 'fs-5 fw-semibold' } , ( ) => value [ 0 ] ) ,
74+ h ( CCol , { class : 'fs-5 fw-semibold' } , ( ) => value . value ) ,
7075 h (
7176 CCol ,
7277 { class : 'text-uppercase text-medium-emphasis small' } ,
73- ( ) => value [ 1 ] ,
78+ ( ) => value . title ,
7479 ) ,
7580 ] ,
7681 } ,
0 commit comments