style: update statistic type

pull/5627/head
tangjinzhou 3 years ago
parent 4439e0f3c3
commit d9b3d8057f

@ -3,7 +3,7 @@ import { defineComponent, onBeforeUnmount, onMounted, onUpdated, ref } from 'vue
import omit from '../_util/omit';
import initDefaultProps from '../_util/props-util/initDefaultProps';
import Statistic, { statisticProps } from './Statistic';
import type { countdownValueType, FormatConfig } from './utils';
import type { countdownValueType, FormatConfig, valueType } from './utils';
import { formatCountdown as formatCD } from './utils';
const REFRESH_INTERVAL = 1000 / 30;
@ -88,11 +88,13 @@ export default defineComponent({
stopTimer();
});
return () => {
const value = props.value as valueType;
return (
<Statistic
ref={statistic}
{...{
...omit(props, ['onFinish', 'onChange']),
value,
valueRender: valueRenderHtml,
formatter: formatCountdown,
}}

@ -3,7 +3,7 @@ import { defineComponent } from 'vue';
import PropTypes from '../_util/vue-types';
import initDefaultProps from '../_util/props-util/initDefaultProps';
import StatisticNumber from './Number';
import type { countdownValueType } from './utils';
import type { valueType } from './utils';
import Skeleton from '../skeleton/Skeleton';
import useConfigInject from '../_util/hooks/useConfigInject';
@ -13,7 +13,7 @@ export const statisticProps = () => ({
groupSeparator: String,
format: String,
value: {
type: [String, Number, Object] as PropType<countdownValueType>,
type: [String, Number, Object] as PropType<valueType>,
},
valueStyle: { type: Object as PropType<CSSProperties>, default: undefined as CSSProperties },
valueRender: PropTypes.any,

Loading…
Cancel
Save