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

Menu 组件使用单文件方式递归生成菜单,select和click方法取不到title #1723

Closed
1 task
youki666 opened this issue Jan 14, 2020 · 4 comments
Closed
1 task

Comments

@youki666
Copy link

  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

1.4.10

Environment

macos 10.15

Reproduction link

https://github.com/youki666/ant-vue.git

Steps to reproduce

就是那个单文件递归菜单click和select方法取不到title

What is expected?

希望点击菜单能得到该item的title值

What is actually happening?

单文件递归的时候click事件title取不到

@sendya
Copy link
Member

sendya commented Jan 14, 2020

事件名称 说明 回调参数
click 点击 MenuItem 调用此函数 function({ item, key, keyPath })
deselect 取消选中时调用,仅在 multiple 生效 function({ item, key, selectedKeys })
openChange SubMenu 展开/关闭的回调 function(openKeys: string[])
select 被选中时调用 function({ item, key, selectedKeys })

文档说的 item 是 VueComponent Menu.Item 这个组件,并不是你的当前数组 item

@youki666
Copy link
Author

那种单文件递归树生成的菜单如何点击获取数据呢,您能给点思路吗,我看它文档说使用单文件方式递归生成菜单,因组件内部会动态更改a-sub-menu的属性,如果拆分成单文件,无法将属性挂载到a-sub-menu上,需要自行声明属性并挂载。

@github-actions
Copy link

github-actions bot commented Jan 4, 2021

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days

@github-actions github-actions bot added the Stale label Jan 4, 2021
@youki666 youki666 closed this as completed Jan 7, 2021
@github-actions
Copy link

github-actions bot commented Jan 8, 2022

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants