Quellcode durchsuchen

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

zhouna vor 6 Jahren
Ursprung
Commit
e38e5f69cf
1 geänderte Dateien mit 3 neuen und 1 gelöschten Zeilen
  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() {