Skip to content

Commit

Permalink
fix: #42
Browse files Browse the repository at this point in the history
  • Loading branch information
d3george committed Apr 6, 2024
1 parent 74bbdd5 commit f137a8c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
7 changes: 1 addition & 6 deletions src/layouts/dashboard/nav-horizontal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,7 @@ export default function NavHorizontal() {
* events
*/
const onOpenChange: MenuProps['onOpenChange'] = (keys) => {
const latestOpenKey = keys.find((key) => openKeys.indexOf(key) === -1);
if (latestOpenKey) {
setOpenKeys(keys);
} else {
setOpenKeys([]);
}
setOpenKeys(keys);
};
const onClick: MenuProps['onClick'] = ({ key }) => {
// 从扁平化的路由信息里面匹配当前点击的那个
Expand Down
7 changes: 1 addition & 6 deletions src/layouts/dashboard/nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,7 @@ export default function Nav(props: Props) {
* events
*/
const onOpenChange: MenuProps['onOpenChange'] = (keys) => {
const latestOpenKey = keys.find((key) => openKeys.indexOf(key) === -1);
if (latestOpenKey) {
setOpenKeys(keys);
} else {
setOpenKeys([]);
}
setOpenKeys(keys);
};
const onClick: MenuProps['onClick'] = ({ key }) => {
// 从扁平化的路由信息里面匹配当前点击的那个
Expand Down

0 comments on commit f137a8c

Please sign in to comment.