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

fix: multistage-menu #59

Merged
merged 2 commits into from
Apr 26, 2022
Merged

Conversation

hehehai
Copy link
Contributor

@hehehai hehehai commented Apr 17, 2022

Types of changes

  • New feature
  • Bug fix
  • Documentation change
  • Coding style change
  • Refactoring
  • Performance improvement
  • Test cases
  • Continuous integration
  • Typescript definition change
  • Breaking change

Background and context

Solution

多层菜单的渲染,分为 独立菜单,父级菜单 ,需要先判断菜单类型再进行嵌套

How is the change tested?

Changelog

Changelog(CN) Changelog(EN) Related issues
支持顶层独立菜单 Support top-level independent menu arco-design/arco-design-vue#965
多层菜单嵌套异常 Multi level menu nesting exception arco-design/arco-design-vue#930 (comment)

Checklist:

  • Provide changelog for relevant changes (e.g. bug fixes and new features) if applicable.
  • Changes are submitted to the appropriate branch (e.g. features should be submitted to feature branch and others should be submitted to master branch)

Other information

@hehehai hehehai force-pushed the fix-multistage-menu branch from b027219 to fcdc9c0 Compare April 17, 2022 13:02
@@ -1,7 +1,7 @@
<template>
<router-view>
<template #default>
<router-view v-slot="{ Component, route }">
<template #default="{ Component: ParentComponent }">
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kirazxyun 不确定这样是否可行,但简单测试顶层菜单情况,二级菜单情况可以正常显示(有时会路由变化了,但是组件没更新出来,Workplace, DataAnalysis 这两个,把 keep-alive 注释掉也是这种情况,不知道什么问题了)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kirazxyun 你好,这块要怎么处理?,目前还是有问题的 🧐

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hehehai 此处路由多个嵌套那个问题是为了防止页面缓存失效。后续优化打算进行层级扁平。如果是个人项目根据需要进行处理哈。

: ``;
const r = (
? () => h(compile(`<${element?.meta?.icon}/>`))
: undefined;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里用了 undefined ,使用空字符串依然会出现占位

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

使用 null 会更合理一些

@sHow8e sHow8e added the enhancement New feature or request label Apr 20, 2022
@hehehai hehehai force-pushed the fix-multistage-menu branch from 8c3d786 to f856250 Compare April 20, 2022 11:44
@hehehai hehehai mentioned this pull request Apr 22, 2022
1 task
@sHow8e
Copy link
Member

sHow8e commented Apr 22, 2022

@hehehai hihi。先感谢PR。一个PR里尽量只做一个功能点的增加或者一个问题的修复。路由多个嵌套那个问题是为了防止页面缓存失效。麻烦进行一下PR拆分哈。

@hehehai
Copy link
Contributor Author

hehehai commented Apr 22, 2022

@sHow8e 😵 我分开的时候,你们让我合成一个,合成一个,你们让我分开 😳 真难

@sHow8e
Copy link
Member

sHow8e commented Apr 22, 2022

@hehehai 抱歉哈。可能是因为信息不同步。是这样的。因为要做更新日志和issue关联。拆开后会好一点。感谢。有问题可以进入我们飞书群一起交流讨论哈。

@hehehai
Copy link
Contributor Author

hehehai commented Apr 22, 2022

@sHow8e 好吧,这样处理你看行不行

  1. menu,处理为一个 commit feat: support multi-level nested menus
  2. page-layout,tab-bar,处理为一个 commit fix: nested route cache

你觉得呢?

@sHow8e
Copy link
Member

sHow8e commented Apr 22, 2022

@hehehai page-layout可以先不用修改。我先确认一下解决方案哈。你可以把menu和tab-bar的修改分开提交就行。3q

@hehehai
Copy link
Contributor Author

hehehai commented Apr 22, 2022

@sHow8e 这里修改 page-layout 的原因就是,当有独立的顶层菜单的问题,路由页面不会展示

@sHow8e
Copy link
Member

sHow8e commented Apr 22, 2022

@hehehai 我晓得了。如果修改的话和页面缓存功能就互斥了。估计要底层处理一下。那你带上吧。后续我再一起处理一下。3q

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
3 participants