@coreui/vue
Version:
UI Components Library for Vue.js
58 lines (55 loc) • 1.87 kB
JavaScript
import { defineComponent, h } from 'vue';
import { CCard } from '../card/CCard.js';
import { CCardBody } from '../card/CCardBody.js';
import '../card/CCardFooter.js';
import '../card/CCardGroup.js';
import '../card/CCardHeader.js';
import '../card/CCardImage.js';
import '../card/CCardImageOverlay.js';
import '../card/CCardLink.js';
import '../card/CCardSubtitle.js';
import '../card/CCardText.js';
import '../card/CCardTitle.js';
const CWidgetStatsE = defineComponent({
name: 'CWidgetStatsE',
props: {
/**
* Title for your component. If you want to pass non-string value please use dedicated slot `<template #title>...</template>`
*/
title: String,
/**
* Value for your component. If you want to pass non-string or non-number value please use dedicated slot `<template #value>...</template>`
*/
value: {
type: [Number, String],
default: 0,
},
},
/**
* Location for chart component.
*
* @slot chart
*/
setup(props, { slots }) {
return () => h(CCard, {}, () => h(CCardBody, {
class: 'text-center',
}, () => [
(props.title || slots.title) &&
h('div', {
class: 'text-body-secondary small text-uppercase font-weight-bold',
}, {
default: () => (slots.title && slots.title()) || props.title,
}),
(props.value || slots.value) &&
h('div', {
class: 'h2 py-3',
}, {
default: () => (slots.value && slots.value()) || props.value,
}),
slots.chart && slots.chart(),
slots.default && slots.default(),
]));
},
});
export { CWidgetStatsE };
//# sourceMappingURL=CWidgetStatsE.js.map