提交 6e3422fe 编写于 作者: J jim

fix #1532 menu select bug

上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册