refactor(home): 重构首页配置和路由处理

- 修改首页路由动态加载逻辑
- 优化滑动导航组件中的菜单处理
- 调整 Vuex store 中的 mods 数据处理方式
- 重构 main.js 中的 HomePage 配置
This commit is contained in:
aixianling
2024-12-23 14:38:32 +08:00
parent b7c0350134
commit 711db33df3
4 changed files with 7 additions and 11 deletions

View File

@@ -39,12 +39,12 @@ export default {
},
computed: {
...mapGetters(['mods']),
navs: v => [v.$HomePage,...v.sortList(v.menuList)],
navs: v => [v.$HomePage, ...v.sortList(v.menuList)],
menuPath() {
console.log(this.$route.name)
let paths = [], current = this.mods?.find(e => e.name == this.$route.name)
const mods = [this.$HomePage, ...this.mods]
let paths = [], current = mods?.find(e => e.component == this.$route.name)
const findParent = id => {
let menu = this.mods?.find(e => e.id == id)
let menu = mods?.find(e => e.id == id)
if (menu) {
paths.push(menu.id)
if (!!menu.parentId) findParent(menu.parentId)