diff --git a/src/components/Charts/WaterWave/index.js b/src/components/Charts/WaterWave/index.js index 0fd61a957af2066b12a14fce53f02659f1b87686..450b31ff75140760bb951d1110f45c8a0f53cc35 100644 --- a/src/components/Charts/WaterWave/index.js +++ b/src/components/Charts/WaterWave/index.js @@ -6,7 +6,6 @@ import styles from './index.less'; /* eslint no-mixed-operators: 0 */ // riddle: https://riddle.alibaba-inc.com/riddles/2d9a4b90 -export default @autoHeight() class WaterWave extends PureComponent { state = { @@ -25,6 +24,13 @@ class WaterWave extends PureComponent { ); } + componentDidUpdate(props) { + const { percent } = this.props; + if (props.percent !== percent) { + this.renderChart(); + } + } + componentWillUnmount() { cancelAnimationFrame(this.timer); if (this.node) { @@ -203,3 +209,5 @@ class WaterWave extends PureComponent { ); } } + +export default WaterWave;