瀏覽代碼

fix city unload error

jim 8 年之前
父節點
當前提交
7c1d6a9962
共有 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',
       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() {
   getProvinceOption() {
     return this.getOption(this.props.province);
     return this.getOption(this.props.province);
   }
   }