0

clipboard.png

let newMenus = curMenus.map((menu, menuIndex) => {
      if (menu.children && this.hasMenus(menu.children)) {
        return (
          <Dropdown
            key={menuIndex}
            overlay={() => {
              return menu.children.map((children, index) => (
                <Menu key={index}>
                  <Menu.Item>
                    <Link to={children.url} activeClassName="selected">
                      {children.resourceName}
                    </Link>
                  </Menu.Item>
                </Menu>
              ));
            }}
            placement="bottomLeft"
          >
            <div>
              <div>
                <span>{menu.resourceName}</span>
              </div>
            </div>
          </Dropdown>
        );
      } else {
        return (
          menu.isShow == "1" && (
            <NavLink to={menu.url} activeClassName="selected" key={menuIndex}>
              <div>
                <span>{menu.resourceName}</span>
              </div>
            </NavLink>
          )
        );
      }
    });
    return <div className="top-menu-container">{newMenus}</div>;
Awbeci 2.1k
7月9日提问
1 个回答
1

已采纳

map Menu.Item

撰写答案

推广链接