import React, { Component } from 'react'; import { ConfigListProp } from '../../chart.d'; import { dateFormat, getValue } from '../../utils'; import TextWenBenKuang from '../wenbenkuang/wenbenkuang'; import styles from "./index.module.css"; interface Prop { } interface State { time : Date ; } export default class TextShiShiShiJian extends TextWenBenKuang{ state : State = { time : new Date(), } componentDidMount(){ setInterval(() => { this.setState({ time : new Date() }) }, 1000); } render(){ const {data} = this.props; const setting: ConfigListProp = data.data.data.config.config const {time} = this.state; return this.renderValue(data,dateFormat(time,getValue(setting,'时间格式'))) } }