Commit 6e3422fe authored by jim's avatar jim

fix #1532 menu select bug

parent 9da8cb53
......@@ -19,6 +19,15 @@ const menuMap = {
currentUser: user.currentUser,
}))
export default class Info extends Component {
static getDerivedStateFromProps(props, state) {
const { match, location } = props;
let selectKey = location.pathname.replace(`${match.path}/`, '');
selectKey = menuMap[selectKey] ? selectKey : 'base';
if (selectKey !== state.selectKey) {
return { selectKey };
}
return null;
}
constructor(props) {
super(props);
const { match, location } = props;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment