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 children 仅有唯一子项时只渲染唯一子项 #488

Open
3 tasks done
codesyofo opened this issue Jun 13, 2024 · 2 comments · May be fixed by #489
Open
3 tasks done

menu children 仅有唯一子项时只渲染唯一子项 #488

codesyofo opened this issue Jun 13, 2024 · 2 comments · May be fixed by #489

Comments

@codesyofo
Copy link
Contributor

Description

rt

Suggested solution

rt

Alternative

No response

Additional context

No response

Validations

@codesyofo codesyofo linked a pull request Jun 13, 2024 that will close this issue
@qmhc
Copy link
Collaborator

qmhc commented Jun 18, 2024

我认为这是一个非常罕见的使用案例,不太适合内置进组件功能,应该在使用 Menu 前对数据源进行处理。

是有什么其他原因导致源数据难以处理吗?

@codesyofo
Copy link
Contributor Author

codesyofo commented Jun 18, 2024

我认为这是一个非常罕见的使用案例,不太适合内置进组件功能,应该在使用 Menu 前对数据源进行处理。

是有什么其他原因导致源数据难以处理吗?

路由中需要 layout 包裹,但菜单中不需要 layout 作一级

{
  path: '/test',
  name: 'test',
  component: 'layout',
  title: '首页',
  children: [
    {
      // onlyOne: true
      // 该菜单项即可当一级菜单,也可当二级菜单(配置更多同级菜单项);
      // 作一级菜单/二级菜单可灵活切换

      // onlyOne: false
      // 受限于layout的配置后,该菜单项只能做二级菜单;
      // 如果改为一级菜单后,则需要为该菜单项增加layout;
      // 在一级菜单和二级菜单切换会有些不太友好
      path: '',
      name: 'home',
      component: '/Home.vue',
    },
  ]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants