Browse Source

fix city unload error

jim 8 years ago
parent
commit
50845e4f99
1 changed files with 8 additions and 0 deletions
  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);
   }