Explorar el Código

推送时不要跳到提示信息位置

zhouna hace 6 años
padre
commit
e38e5f69cf
Se han modificado 1 ficheros con 3 adiciones y 1 borrados
  1. 3 1
      src/components/PushItems/TipsMsg/index.jsx

+ 3 - 1
src/components/PushItems/TipsMsg/index.jsx

@@ -6,11 +6,13 @@ class TipsMsg extends Component {
     constructor(props) {
         super(props);
     }
-    componentWillReceiveProps(){
+    componentWillReceiveProps(next){
         //滚动条定位到提示信息模块
+      if(JSON.stringify(next.tips)!=JSON.stringify(this.props.tips)){
         const {patDom} = this.props;
         const ht = $(patDom.current).height();
         $(patDom.current).scrollTop(ht);
+      }
     }
 
     render() {