-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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
Refactor menu generation strategy to support sub-menu items. #5177
Conversation
Signed-off-by: Ryan Wang <i@ryanc.cc>
Signed-off-by: Ryan Wang <i@ryanc.cc>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5177 +/- ##
=========================================
Coverage 55.98% 55.98%
Complexity 3027 3027
=========================================
Files 538 538
Lines 17973 17973
Branches 1319 1319
=========================================
Hits 10062 10062
Misses 7367 7367
Partials 544 544 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Ryan Wang <i@ryanc.cc>
Signed-off-by: Ryan Wang <i@ryanc.cc>
Signed-off-by: Ryan Wang <i@ryanc.cc>
Signed-off-by: Ryan Wang <i@ryanc.cc>
Signed-off-by: Ryan Wang <i@ryanc.cc>
Signed-off-by: Ryan Wang <i@ryanc.cc>
Signed-off-by: Ryan Wang <i@ryanc.cc>
Signed-off-by: Ryan Wang <i@ryanc.cc>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: JohnNiang The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
…v#5177) #### What type of PR is this? /area console /kind feature /milestone 2.12.x #### What this PR does / why we need it: 重构 Console 和 UC 的菜单生成逻辑,支持配置二级菜单项。 <img width="557" alt="图片" src="https://github.com/halo-dev/halo/assets/21301288/0f1717ce-bd30-448b-9625-24bfd5e1c5ae"> 配置方式: ```ts export default definePlugin({ components: {}, routes: [ { parentName: "AttachmentsRoot", route: { name: "S3Link", path: "s3-link", component: markRaw(HomeView), meta: { title: "S3 关联", searchable: true, menu: { name: "S3 关联", icon: markRaw(IconAddCircle), priority: 0, mobile: true, }, }, }, }, ], }); ``` 只需要指定 parentName 并在其下 route 需要配置 meta.menu 即可。 最终文档会补充在:halo-dev/docs#291 #### Which issue(s) this PR fixes: Fixes halo-dev#4807 #### Special notes for your reviewer: 1. 可以按照上述配置方式测试。 2. 可以安装 [plugin-s3-1.5.0-SNAPSHOT.jar.zip](https://github.com/halo-dev/halo/files/13959977/plugin-s3-1.5.0-SNAPSHOT.jar.zip) 进行测试。 #### Does this PR introduce a user-facing change? ```release-note 重构 Console 和 UC 的菜单生成逻辑,支持配置二级菜单项。 ```
What type of PR is this?
/area console
/kind feature
/milestone 2.12.x
What this PR does / why we need it:
重构 Console 和 UC 的菜单生成逻辑,支持配置二级菜单项。
配置方式:
只需要指定 parentName 并在其下 route 需要配置 meta.menu 即可。
最终文档会补充在:halo-dev/docs#291
Which issue(s) this PR fixes:
Fixes #4807
Special notes for your reviewer:
Does this PR introduce a user-facing change?