We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
代码如下
const renderTable = (nodes: TableItem[]) => { return nodes.map((item) => { if (!item.children) { return ( <MenuItem className={'flex h-10 items-center rounded-md text-sm hover:bg-gray-100'} key={item.key} > {item.label} </MenuItem> ); } return ( <SubMenu className={'cursor-pointer text-sm'} key={item.key} title={ <div className={'flex h-10 items-center justify-between rounded-md text-sm'}> {item.label} </div> } > {renderTable(item.children)} </SubMenu> ); }); }; const [openKeys, handleOpenKeys] = useState<string[]>([]); const onOpenChange = (openKeys: string[]) => { handleOpenKeys(openKeys); };
<Menu className={'doc-table w-full px-2'} mode={'inline'} openKeys={openKeys} onOpenChange={onOpenChange} > {renderTable(items)} </Menu>
可以打开子菜单,但是关闭不了,点击的时候,打印可以看到openKeys已经发生了改变,但是子菜单还是收不回去
The text was updated successfully, but these errors were encountered:
No branches or pull requests
代码如下
可以打开子菜单,但是关闭不了,点击的时候,打印可以看到openKeys已经发生了改变,但是子菜单还是收不回去
The text was updated successfully, but these errors were encountered: