if (parseInt(fullHeight) > parseInt(limitedHeight)) { this.setState({ shouldShowReadMore: true }, () => { this.props.onReady && this.props.onReady(); }); } else { this.props.onReady && this.props.onReady(); } 需要加parseInt,小数点后面太多容易出现误差。 <img width="314" alt="WeChat4cc72858bc2ab0cc4217b42198b86d41" src="https://user-images.githubusercontent.com/26929903/76854720-97d02e80-688a-11ea-8cc3-3b984ef398a0.png">