From b627a6813bf3cc9df3f35d66c48655f729667ad9 Mon Sep 17 00:00:00 2001 From: yuri Date: Mon, 5 Mar 2018 14:01:18 +0800 Subject: [PATCH] =?UTF-8?q?menu:=E5=A2=9E=E5=8A=A0submenu-click=E3=80=81su?= =?UTF-8?q?bmenu-enter=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/docs/zh-cn/menu.md | 2 ++ vb/components/menu/menu.vue | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/docs/zh-cn/menu.md b/src/docs/zh-cn/menu.md index 94889ec..db324f9 100644 --- a/src/docs/zh-cn/menu.md +++ b/src/docs/zh-cn/menu.md @@ -653,6 +653,8 @@ export default { | 事件 | 说明 | 参数 | |---------- |-------------- |---------- |-------- | +| submenu-click | 点击subMenu title时触发 | 被点击的submenu的数据 | +| submenu-enter | 鼠标移入subMenu title时触发 | 鼠标移入的submenu的数据 | | item-click | 点击Menu Item时触发 | 从根到叶的数组,包含路径上的每个节点的数据 | ### Menu:Data Prop diff --git a/vb/components/menu/menu.vue b/vb/components/menu/menu.vue index 6db0756..abd1e8d 100644 --- a/vb/components/menu/menu.vue +++ b/vb/components/menu/menu.vue @@ -197,11 +197,13 @@ export default { }, clickTriggerOpen(disabled, index) { if (!disabled && this.innerMode === 'inline') { + this.$emit('submenu-click', this.data[index]); this.setOpen(index, !this.data[index].expand); } }, mouseTriggerOpen(disabled, index, status) { if (!disabled && this.innerMode !== 'inline') { + this.$emit('submenu-enter', this.data[index]); if (this.timer[index]) clearTimeout(this.timer[index]); this.timer[index] = setTimeout(() => this.setOpen(index, status), 300); }