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

手风琴模式下,更改菜单value,自动展开菜单/When the menu is in accordion mode, the change value will expand automatically. #2562

Closed
windinternet opened this issue Mar 6, 2022 · 10 comments
Labels
feature request New feature or request priority: low

Comments

@windinternet
Copy link

This function solves the problem (这个功能解决的问题)

当使用tab组件配合做多页admin时,可以在切换tab的时候自动展开对应的菜单

When you use the tab component to cooperate with multi page admin, you can automatically expand the corresponding menu when switching tabs

Expected API (期望的 API)

增加属性,来决定要不要自动展开菜单,即当前value所在路径
auto-expand : bool

@github-actions github-actions bot added the feature request New feature or request label Mar 6, 2022
@07akioni
Copy link
Collaborator

07akioni commented Mar 6, 2022

为啥要 tabs 和 menu 共存?我觉得这个场景不是很常见。

@windinternet
Copy link
Author

做多页admin模板使用,不过这个不是重点,重点是希望有一个api来展开指定菜单,如果是手风琴模式,则收起其他菜单。

@07akioni
Copy link
Collaborator

07akioni commented Mar 8, 2022

你这个需求我感觉明确一点说应该是当前选中的值一定要展开吧,只要不是用户继续手动关掉了

@07akioni
Copy link
Collaborator

07akioni commented Mar 8, 2022

还是需要你把预期行为描述的准确一点,我还不能理解的特别明白

@Nakus0426
Copy link
Contributor

还是需要你把预期行为描述的准确一点,我还不能理解的特别明白

这个需求应该是指提供一个属性来选择菜单当前的选中值是否自动展开

@07akioni
Copy link
Collaborator

07akioni commented Mar 9, 2022

还是需要你把预期行为描述的准确一点,我还不能理解的特别明白

这个需求应该是指提供一个属性来选择菜单当前的选中值是否自动展开

那我再手动点击父级菜单让他合起来呢

@Nakus0426
Copy link
Contributor

单次选中值改变后,用户的操作覆盖组件的操作,下次选中值改变时再覆盖用户的操作。选中值改变时菜单自动展开选中的菜单项,用户手动关闭后如果再改变选中值,就再自动展开

@07akioni
Copy link
Collaborator

07akioni commented Mar 10, 2022

下次选中值改变时再覆盖用户的操作。选中值改变时菜单自动展开选中的菜单项,用户手动关闭后如果再改变选中值,就再自动展开

基本能理解了,有空看看

@07akioni
Copy link
Collaborator

07akioni commented Mar 20, 2022

提供了一个 showOption(key?) 的方法,让用户指定哪个要被展开,在需要的时机调一下就好

因为这个事情是外源的,在组件内部 watch 不是特别合理

@windinternet
Copy link
Author

感谢大佬支持!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request priority: low
Projects
None yet
Development

No branches or pull requests

3 participants