Prechádzať zdrojové kódy

fix city unload error

jim 8 rokov pred
rodič
commit
50845e4f99
1 zmenil súbory, kde vykonal 8 pridanie a 0 odobranie
  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);
   }