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

delete some no no needrequestAnimationFrame

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