From 50845e4f9996a115d900bc40a1e08aec40a22dc5 Mon Sep 17 00:00:00 2001 From: jim Date: Mon, 12 Feb 2018 14:19:04 +0800 Subject: [PATCH] fix city unload error --- src/routes/Userinfo/GeographicView.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/routes/Userinfo/GeographicView.js b/src/routes/Userinfo/GeographicView.js index 345e6bb2..625cb6ff 100644 --- a/src/routes/Userinfo/GeographicView.js +++ b/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); } -- GitLab