Skip to content
New issue

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

[BUG]AntDesign.ProLayout.BasicLayout 的参数OnOpenChange事件无效 无法更新OpenKeys #153

Open
onsuper opened this issue May 23, 2023 · 0 comments

Comments

@onsuper
Copy link

onsuper commented May 23, 2023

🐛 bug 描述
📷 复现步骤 | Recurrence steps
<AntDesign.ProLayout.BasicLayout Logo="@("logo.svg")" MenuData="_menuData" OpenKeys="this.openKeys" OnOpenChange="this.onOpenChange">

string[] openKeys = { "" }; void onOpenChange(string[] openKeys) { var latestOpenKey = openKeys.FirstOrDefault(key => !this.openKeys.Contains(key)); if (_menuData.ToList().Any(t => t.Key.Contains(latestOpenKey))) { this.openKeys = openKeys; } else { this.openKeys = !string.IsNullOrEmpty(latestOpenKey) ? new[] { latestOpenKey } : Array.Empty<string>(); } }

🏞 期望结果 | Expected results
https://antblazor.com/zh-CN/components/menu#components-menu-demo-sider-current

💻 复现代码 | Recurrence code
© 版本信息
Ant Design Pro 版本: [0.14.4.1]
umi 版本
浏览器环境
开发环境 [windows10 vs2022]

🚑 其他信息

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant