From e465295276d968f7a43377af6657cec3b572c81b Mon Sep 17 00:00:00 2001 From: nikogu <644506165@qq.com> Date: Wed, 1 Nov 2017 13:18:04 +0800 Subject: [PATCH] fixed: https://github.com/ant-design/ant-design-pro/issues/63#issuecomment-340979650 --- src/routes/Profile/AdvancedProfile.js | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/routes/Profile/AdvancedProfile.js b/src/routes/Profile/AdvancedProfile.js index 66d3bd37..9cb95f84 100644 --- a/src/routes/Profile/AdvancedProfile.js +++ b/src/routes/Profile/AdvancedProfile.js @@ -1,6 +1,5 @@ import React, { Component } from 'react'; -import addEventListener from 'rc-util/lib/Dom/addEventListener'; -import debounce from 'lodash.debounce'; +import Debounce from 'lodash-decorators/debounce'; import { connect } from 'dva'; import { Button, Menu, Dropdown, Icon, Row, Col, Steps, Card, Popover, Badge, Table, Tooltip, Divider } from 'antd'; import classNames from 'classnames'; @@ -93,7 +92,7 @@ const popoverContent = ( 未响应} /> -

耗时:2小时25分钟

+

耗时:2小时25分钟

); @@ -156,21 +155,18 @@ export default class AdvancedProfile extends Component { }); this.setStepDirection(); - this.resizeEvent = addEventListener(window, 'resize', debounce(this.setStepDirection, 100, { - leading: false, - })); + window.addEventListener('resize', this.setStepDirection); } componentWillUnmount() { - if (this.resizeEvent) { - this.resizeEvent.remove(); - } + window.removeEventListener('resize', this.setStepDirection); } onOperationTabChange = (key) => { this.setState({ operationkey: key }); } + @Debounce(200) setStepDirection = () => { const { stepDirection } = this.state; const w = getWindowWidth(); @@ -233,7 +229,7 @@ export default class AdvancedProfile extends Component { 32943898021309809423 3321944288191034921 18112345678 - 曲丽丽 18100000000 浙江省杭州市西湖区黄姑山路工专路交叉路口 + 曲丽丽 18100000000 浙江省杭州市西湖区黄姑山路工专路交叉路口 725 -- GitLab