Skip to content
This repository was archived by the owner on Aug 11, 2020. It is now read-only.
This repository was archived by the owner on Aug 11, 2020. It is now read-only.

🐛[BUG]ProLayout 6.2.5 SiderMenu的openKeys selectedKeys无法及时更新 #580

@johnnylc

Description

@johnnylc

🐛 bug 描述

当采用异步加载menu时,openKeys和selectedKeys无法及时根据menu变化更新。

📷 复现步骤

  state = {
    menuData: [] //若使用defaultMenus作为初值则可以正常显示
  };

  componentDidMount() {
    setTimeout(() => this.setState({ menuData: defaultMenus }), 1000);
  }

模拟异步更新menuData,菜单无法跟随路由正确选中、展开。

🏞 期望结果

menuData变化时,菜单正常选中并展开

💻 复现代码 [提供可复现的代码,仓库,或线上示例]

https://codesandbox.io/s/busy-sea-2rjr6?file=/demo.tsx

© 版本信息

  • Ant Design 版本: 4.4.2
    -ProLayout 版本:6.2.5
  • 浏览器环境 84.0.4147.89
  • 开发环境 mac OS

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions