style: update statistic type
parent
4439e0f3c3
commit
d9b3d8057f
|
@ -3,7 +3,7 @@ import { defineComponent, onBeforeUnmount, onMounted, onUpdated, ref } from 'vue
|
||||||
import omit from '../_util/omit';
|
import omit from '../_util/omit';
|
||||||
import initDefaultProps from '../_util/props-util/initDefaultProps';
|
import initDefaultProps from '../_util/props-util/initDefaultProps';
|
||||||
import Statistic, { statisticProps } from './Statistic';
|
import Statistic, { statisticProps } from './Statistic';
|
||||||
import type { countdownValueType, FormatConfig } from './utils';
|
import type { countdownValueType, FormatConfig, valueType } from './utils';
|
||||||
import { formatCountdown as formatCD } from './utils';
|
import { formatCountdown as formatCD } from './utils';
|
||||||
|
|
||||||
const REFRESH_INTERVAL = 1000 / 30;
|
const REFRESH_INTERVAL = 1000 / 30;
|
||||||
|
@ -88,11 +88,13 @@ export default defineComponent({
|
||||||
stopTimer();
|
stopTimer();
|
||||||
});
|
});
|
||||||
return () => {
|
return () => {
|
||||||
|
const value = props.value as valueType;
|
||||||
return (
|
return (
|
||||||
<Statistic
|
<Statistic
|
||||||
ref={statistic}
|
ref={statistic}
|
||||||
{...{
|
{...{
|
||||||
...omit(props, ['onFinish', 'onChange']),
|
...omit(props, ['onFinish', 'onChange']),
|
||||||
|
value,
|
||||||
valueRender: valueRenderHtml,
|
valueRender: valueRenderHtml,
|
||||||
formatter: formatCountdown,
|
formatter: formatCountdown,
|
||||||
}}
|
}}
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { defineComponent } from 'vue';
|
||||||
import PropTypes from '../_util/vue-types';
|
import PropTypes from '../_util/vue-types';
|
||||||
import initDefaultProps from '../_util/props-util/initDefaultProps';
|
import initDefaultProps from '../_util/props-util/initDefaultProps';
|
||||||
import StatisticNumber from './Number';
|
import StatisticNumber from './Number';
|
||||||
import type { countdownValueType } from './utils';
|
import type { valueType } from './utils';
|
||||||
import Skeleton from '../skeleton/Skeleton';
|
import Skeleton from '../skeleton/Skeleton';
|
||||||
import useConfigInject from '../_util/hooks/useConfigInject';
|
import useConfigInject from '../_util/hooks/useConfigInject';
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ export const statisticProps = () => ({
|
||||||
groupSeparator: String,
|
groupSeparator: String,
|
||||||
format: String,
|
format: String,
|
||||||
value: {
|
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 },
|
valueStyle: { type: Object as PropType<CSSProperties>, default: undefined as CSSProperties },
|
||||||
valueRender: PropTypes.any,
|
valueRender: PropTypes.any,
|
||||||
|
|
Loading…
Reference in New Issue