Commit 85869caa authored by ι™ˆεΈ…'s avatar ι™ˆεΈ…

fix #2146 Water chart no update

parent 80e2a58f
......@@ -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;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment