Skip to content

Commit

Permalink
feat(dropdown-menu): enable events open and close
Browse files Browse the repository at this point in the history
  • Loading branch information
betavs committed Sep 15, 2023
1 parent 405c95f commit a6d89ad
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
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');
},
};

methods = {
Expand Down

0 comments on commit a6d89ad

Please sign in to comment.