使用React框架时,组件在使用<span>{ Math.abs(goal.goalInfo.pretimes - goal.usergoalInfo.cpt_times )}</span>这一语句时出现警告:Received NaN for the `children` attribute. If this is expected, cast the value to a string.
解决:将运算结果转为字符串 <span>{ Math.abs(goal.goalInfo.pretimes - goal.usergoalInfo.cpt_times ).toString() }</span>