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

[Feature Request] DropdownMenu 请求添加一个属性来控制当子菜单只有一个选项时可直接点击并触发菜单切换 #12873

Open
yyrjlw opened this issue May 18, 2024 · 0 comments

Comments

@yyrjlw
Copy link

yyrjlw commented May 18, 2024

这个功能解决了什么问题?

如题所示,DropdownMenu提供一个属性值为boolean类型,当该值为true时。子组件DropdownItem的属性值options若为length为1的数组,则该项菜单去掉向下的图标,并且可直接点击并触发菜单切换,就不用像现有的逻辑一样,需要点击该项菜单还要去点击菜单列表中唯一的一个子菜单才能切换。
亦或者能够提供一个slot能够完全自定义某个菜单项,而不仅仅是title

你期望的 API 是什么样子的?

<van-dropdown-menu :touchOneChild="true"></van-dropdown-menu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant