|
|
|
@ -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; |
|
|
|
|