소스 검색

fix city unload error

jim 8 년 전
부모
커밋
50845e4f99
1개의 변경된 파일8개의 추가작업 그리고 0개의 파일을 삭제
  1. 8 0
      src/routes/Userinfo/GeographicView.js

+ 8 - 0
src/routes/Userinfo/GeographicView.js

@@ -24,6 +24,14 @@ export default class GeographicView extends PureComponent {
       type: 'geographic/fetchProvince',
     });
   };
+  componentDidUpdate(props) {
+    if (!props.value && !!this.props.value && !!this.props.value.province) {
+      this.props.dispatch({
+        type: 'geographic/fetchCity',
+        payload: this.props.value.province.key,
+      });
+    }
+  }
   getProvinceOption() {
     return this.getOption(this.props.province);
   }