-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
feat: 优化缓存二级路由方式 #6944
feat: 优化缓存二级路由方式 #6944
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,7 @@ | |
</div> | ||
<div class="content-container__main" v-if="slots.main"> | ||
<el-card> | ||
<div class="content-container__title" v-if="title"> | ||
<div class="content-container__title"> | ||
<slot name="title"> | ||
<div v-if="showBack"> | ||
<div class="flex justify-between"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 无差异,该段代码为Vue组件的主体内容部分。看起来没有明显的不正确之处或问题,但是可以考虑添加一些基本样式以使代码美观些。 |
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,8 +56,15 @@ router.beforeEach((to, from, next) => { | |
|
||
router.afterEach((to) => { | ||
if (to.meta.activeMenu && !isRedirecting) { | ||
localStorage.setItem('cachedRoute' + to.meta.activeMenu, to.path); | ||
let notMathParam = true; | ||
if (to.matched.some((record) => record.path.includes(':'))) { | ||
notMathParam = false; | ||
} | ||
if (notMathParam) { | ||
localStorage.setItem('cachedRoute' + to.meta.activeMenu, to.path); | ||
} | ||
} | ||
|
||
isRedirecting = false; | ||
NProgress.done(); | ||
}); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这个代码在不同上下文中可能会引入混淆,因为有些地方是用 此外, 由于提供的信息不足以确定问题的具体原因,请提供更多的背景资料以便于针对性帮助或修正错误。 |
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,6 +45,7 @@ const webSiteRouter = { | |
component: () => import('@/views/website/runtime/php/index.vue'), | ||
meta: { | ||
title: 'menu.runtime', | ||
activeMenu: '/websites/runtimes/php', | ||
requiresAuth: false, | ||
}, | ||
}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 该代码没有明显的错误或问题,但在实际应用中可能会根据具体情况有所调整。如果需要进一步的审查和优化,请提供更详细的上下文信息以便于进行具体分析。 |
||
|
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.
在当前日期(2024年11月4日)之前未找到关于代码的详细差异以及任何与不规范或潜在问题相关的描述。对于优化建议,可以考虑调整样式选择器来避免重复应用相同的ID或类,并定期进行性能测试以找出可能的影响效率的操作。具体的技术优化和改进细节需要查看实际项目的代码。
如果您希望获得更具体的帮助,请提供您提到的具体错误信息或特定问题区域供我分析并给出针对性的建议。