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

[comp:Menu]: add component Menu #229

Closed
1 task
qingshan-dev opened this issue Mar 3, 2021 · 3 comments · Fixed by #293
Closed
1 task

[comp:Menu]: add component Menu #229

qingshan-dev opened this issue Mar 3, 2021 · 3 comments · Fixed by #293
Assignees
Milestone

Comments

@qingshan-dev
Copy link
Contributor

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

What problem does this feature solve?

What does the proposed API look like?

@danranVm
Copy link
Member

danranVm commented Apr 7, 2021

为页面和功能提供导航的菜单列表。

何时使用

导航菜单是一个网站的灵魂,用户依赖导航在各个页面中进行跳转。一般分为顶部导航和侧边导航,顶部导航提供全局性的类目和功能,侧边导航提供多级结构来收纳和排列网站架构。

API

ix-menu

MenuProps

名称 说明 类型 默认值 全局配置 备注
collapsed 菜单收起状态 boolean false 仅支持 inline 模式
disabled 是否禁用 boolean false - -
indent inline 模式时的菜单缩进宽度 string | number 24px 仅支持 inline 模式
mode 菜单模式,现在支持垂直、水平和内嵌 vertical | horizontal | inline vertical - -
theme 主题颜色 light light TODO: 支持 dark

MenuEmits

名称 说明 参数类型 备注
click 点击 ix-menu-item 后的回调 { item: IxMenuItem, key: string } -

ix-sub-menu

SubMenuProps

名称 说明 类型 默认值 全局配置 备注
v-model:open 是否展开 boolean false - -
disabled 是否禁用 boolean false - -
icon 菜单图标 string | v-slot:icon - -
title 菜单标题 string | v-slot:title - -

ix-menu-item

MenuItemProps

名称 说明 类型 默认值 全局配置 备注
- - - - -
disabled 是否禁用 boolean false - -
icon 菜单图标 string | v-slot:icon - -
title 菜单标题 string | v-slot:default - -

ix-menu-group

MenuGroupProps

名称 说明 类型 默认值 全局配置 备注
icon 菜单图标 string | v-slot:icon - -
title 菜单标题 string | v-slot:default - -

@danranVm danranVm assigned hele10086 and unassigned danranVm Apr 7, 2021
@rhinonan
Copy link
Contributor

rhinonan commented Apr 7, 2021

  1. 展开 收起这里每一个都有 subMenu 控制 这很麻烦把,这里为啥不用 openKeys 的形式?
  2. ix-sub-menu 的展开收起 应该也有一个事件吧。

@danranVm
Copy link
Member

danranVm commented Apr 8, 2021

  1. 展开 收起这里每一个都有 subMenu 控制 这很麻烦把,这里为啥不用 openKeys 的形式?
  2. ix-sub-menu 的展开收起 应该也有一个时间吧。
  1. 通常的业务场景都是用户拿到一个数组来渲染菜单,此时每个数组元素里会有一个控制是否展开的字段,直接用这个 key 去绑定 subMenu 的 open 就好了。而不需要通过遍历数组,拿到需要展开的 keys 传给 menu 组件。
  2. 有的 open 是支持 v-model 的,所有肯定会有一个 update:open 的 emit

danranVm added a commit that referenced this issue Apr 25, 2021
@danranVm danranVm added this to the v1.0.0 milestone Jul 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants