提交 868f84a6 编写于 作者: 陈帅

delete some no no needrequestAnimationFrame

上级 8e3050ae
...@@ -12,9 +12,7 @@ export default class Radar extends Component { ...@@ -12,9 +12,7 @@ export default class Radar extends Component {
}; };
componentDidMount() { componentDidMount() {
requestAnimationFrame(() => { this.getLegendData();
this.getLegendData();
});
} }
componentDidUpdate(preProps) { componentDidUpdate(preProps) {
......
...@@ -13,10 +13,8 @@ export default class WaterWave extends PureComponent { ...@@ -13,10 +13,8 @@ export default class WaterWave extends PureComponent {
}; };
componentDidMount() { componentDidMount() {
requestAnimationFrame(() => { this.renderChart();
this.renderChart(); this.resize();
this.resize();
});
window.addEventListener( window.addEventListener(
'resize', 'resize',
() => { () => {
......
...@@ -212,19 +212,17 @@ export default class AdvancedProfile extends Component { ...@@ -212,19 +212,17 @@ export default class AdvancedProfile extends Component {
@Bind() @Bind()
@Debounce(200) @Debounce(200)
setStepDirection() { setStepDirection() {
requestAnimationFrame(() => { const { stepDirection } = this.state;
const { stepDirection } = this.state; const w = getWindowWidth();
const w = getWindowWidth(); if (stepDirection !== 'vertical' && w <= 576) {
if (stepDirection !== 'vertical' && w <= 576) { this.setState({
this.setState({ stepDirection: 'vertical',
stepDirection: 'vertical', });
}); } else if (stepDirection !== 'horizontal' && w > 576) {
} else if (stepDirection !== 'horizontal' && w > 576) { this.setState({
this.setState({ stepDirection: 'horizontal',
stepDirection: 'horizontal', });
}); }
}
});
} }
render() { render() {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册