jeecgboot-web前端首页更换,把默认首页/dashboard/analysis换为其他页面

本文档详细介绍了如何将Jeecg前端的默认首页从/dashboard/analysis更改为自定义页面,涉及的文件包括TabLayout.vue、SideMenu.vue、Breadcrumb.vue、router.config.js、mutation-types.js、util.js、JeecgThirdLoginMixin.js和Login.vue,主要操作是替换相关路径和信息。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

问题描述

jeecg前端默认路径为/dashboard/analysis.vue为首页,需求想要改成自己的页面为首页

解决方法

把下述/dashboard/analysis相关的信息替换为自己页面信息即可

1.src/components/layouts/TabLayout.vue

`const indexKey = '/dashboard/analysis'`
	addIndexToFirst() {
	 this.pageList.splice(0, 0, {
	 name: 'dashboard-analysis',
	 path: indexKey,
	 fullPath: indexKey,
	 meta: {
	    icon: '',
	    title: '首页'
	 }
	})
	 this.linkList.splice(0, 0, indexKey)
	 },

2.src/components/menu/SideMenu.vue

增加钩子函数

    created() {
      if (this.menus && this.menus[0].path == '/dashboard/analysis') {
        this.menus.shift()
        console.info(this.menus)
      }
    },

3.src/components/tools/Breadcrumb.vue

这是导航条默认首页名字以及路由

 this.breadList.push({ name: 'dashboard-analysis', path: '/dashboard/analysis', meta: { title: '首页' } })

4.src/config/router.config.js

    path: '/',
    name: 'analysis',
    component: TabLayout,
    meta: { title: '首页' },
    redirect: '/dashboard/analysis',

5.src/store/mutation-types.js

  export const INDEX_MAIN_PAGE_PATH = '/dashboard/analysis'

6.src/utils/util.js

component: resolve => require(['@/components/layouts/TabLayout'], resolve),
          meta: { title: '首页' },
          redirect: '/dashboard/analysis',
          children: [
            ...generateChildRouters(data)
          ]

7.src/views/user/third/JeecgThirdLoginMixin.js

this.$router.push({ path: "/dashboard/analysis" }).catch(()=>{
        console.log('登录跳转首页出错,这个错误从哪里来的')
      })

8. src/views/user/Login.vue

 this.$router.push({ path: "/dashboard/analysis" }).catch(()=>{
          console.log('登录跳转首页出错,这个错误从哪里来的')
        })
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值