diff --git a/src/dropdown-menu/README.en-US.md b/src/dropdown-menu/README.en-US.md index f4d68e59a..8faa079c5 100644 --- a/src/dropdown-menu/README.en-US.md +++ b/src/dropdown-menu/README.en-US.md @@ -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 diff --git a/src/dropdown-menu/README.md b/src/dropdown-menu/README.md index 65b79e3f9..915fb5fe9 100644 --- a/src/dropdown-menu/README.md +++ b/src/dropdown-menu/README.md @@ -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 外部样式类 类名 | 说明 -- | -- diff --git a/src/dropdown-menu/dropdown-menu.ts b/src/dropdown-menu/dropdown-menu.ts index 43bfbd1da..b802ec944 100644 --- a/src/dropdown-menu/dropdown-menu.ts +++ b/src/dropdown-menu/dropdown-menu.ts @@ -44,6 +44,10 @@ export default class DropdownMenu extends SuperComponent { _arrowIcon: calcIcon(v), }); }, + + activeIdx(v: number) { + this.triggerEvent(v === -1 ? 'close' : 'open'); + }, }; methods = {