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

feat(dropdown-menu): enable events open and close #2361

Merged
merged 1 commit into from
Sep 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/dropdown-menu/README.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ external-classes | Array | - | `['t-class', 't-class-item', 't-class-label', 't-
show-overlay | Boolean | true | \- | N
z-index | Number | 11600 | \- | N

### DropdownMenu Events

name | params | description
-- | -- | --
open | \- | \-
close | \- | \-

### DropdownItem Props

name | type | default | description | required
Expand Down
7 changes: 7 additions & 0 deletions src/dropdown-menu/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@ duration | String / Number | 200 | 动画时长 | N
show-overlay | Boolean | true | 是否显示遮罩层 | N
z-index | Number | 11600 | 菜单栏 z-index 层级 | N

### DropdownMenu Events

名称 | 参数 | 描述
-- | -- | --
open | \- | 菜单展开时触发
close | \- | 菜单关闭时触发

### DropdownMenu 外部样式类
类名 | 说明
-- | --
Expand Down
4 changes: 4 additions & 0 deletions src/dropdown-menu/dropdown-menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ export default class DropdownMenu extends SuperComponent {
_arrowIcon: calcIcon(v),
});
},

activeIdx(v: number) {
this.triggerEvent(v === -1 ? 'close' : 'open');
LeeJim marked this conversation as resolved.
Show resolved Hide resolved
},
};

methods = {
Expand Down
Loading