Skip to content

Commit

Permalink
增加Menu的点击回调事件
Browse files Browse the repository at this point in the history
  • Loading branch information
bluescurry authored and sendya committed May 30, 2022
1 parent bceff80 commit 557c031
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/components/RouteMenu/BaseMenu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ const RouteMenu = {
this.sSelectedKeys = args.selectedKeys
}
},
click: args => {
this.$emit('click', args)
},
openChange: handleOpenChange
},
style: {
Expand Down
3 changes: 3 additions & 0 deletions src/components/SiderMenu/SiderMenu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export const SiderMenuProps = {
// listeners
openChange: PropTypes.func,
select: PropTypes.func,
menuClick: PropTypes.func,
}

export const defaultRenderLogo = (h, logo) => {
Expand Down Expand Up @@ -98,6 +99,7 @@ const SiderMenu = {

openChange = () => null,
select = () => null,
menuClick = () => null,

openOnceKey,
siderWidth,
Expand Down Expand Up @@ -167,6 +169,7 @@ const SiderMenu = {
openOnceKey={openOnceKey}
onOpenChange={openChange}
onSelect={select}
onClick={menuClick}
menus={menus}
mode={mode}
theme={theme}
Expand Down

0 comments on commit 557c031

Please sign in to comment.