feat(router): 重新添加主页路由并更新侧边栏样式

- 在 app/index.js 中重新添加主页路由
- 在 generatedRouter/index.js 中添加主页路由的动态导入- 更新 Logo.vue 中的 logo 图片和样式
- 调整 Sidebar.vue 中的 logo 位置和样式
This commit is contained in:
du.meimei
2025-04-23 11:44:57 +08:00
parent 33010a65c9
commit 190ebd8d9d
5 changed files with 45 additions and 20 deletions

BIN
src/assets/images/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

@@ -42,18 +42,18 @@ export default [
hidden: true,
children: [{ path: '/404', component: notFound }]
},
{
path: '/',
component: layout,
redirect: '/home',
name: 'home',
hidden: true,
children: [
{
path: 'home',
component: home
}
]
},
// {
// path: '/',
// component: layout,
// redirect: '/home',
// name: 'home',
// hidden: true,
// children: [
// {
// path: 'home',
// component: home
// }
// ]
// },
{ path: '*', redirect: '/404', hidden: true }
]

View File

@@ -1,7 +1,30 @@
import layout from '@/views/app/layout/layout.vue'
import redirect from '@/views/app/redirect/index.vue'
const home = () => import('@/views/app/Home')
export default [
{
path: '/',
component: layout,
redirect: '/home',
name: 'home',
meta: {
title: '主页',
icon: 'el-icon-s-home',
affix: true
},
children: [
{
path: '/home',
name: 'home-page',
component: home,
meta: {
title: '主页',
icon: 'el-icon-s-home'
}
}
]
},
{
path: '/knowledge',
name: 'knowledge',

View File

@@ -14,7 +14,7 @@
</template>
<script>
import u3 from '@/assets/images/icon/u3.png'
import logo from '@/assets/images/logo.png'
export default {
name: 'SidebarLogo',
props: {
@@ -26,7 +26,7 @@ export default {
data() {
return {
title: 'Vue Admin Template',
logo: u3
logo
}
}
}
@@ -45,7 +45,6 @@ export default {
.sidebar-logo-container {
position: relative;
width: 60px;
height: 60px;
line-height: 50px;
/*background: #2b2f3a;*/
text-align: center;
@@ -56,8 +55,8 @@ export default {
width: 100%;
& .sidebar-logo {
width: 160px;
height: 65px;
width: 35px;
//height: 65px;
vertical-align: middle;
margin-right: 12px;
}

View File

@@ -191,7 +191,6 @@ export default {
// 获取路由数据
let data = this.$store.state.app.sidebarList
// 只获取顶级路由,不需要硬编码路径
// 通过检查路由结构来确定顶级菜单
const topLevelRoutes = data.filter(route => {
// 如果路由有 meta 和 children则认为它是顶级菜单
@@ -248,8 +247,12 @@ export default {
background-color: #fff;
padding: 0 10px;
text-align: center;
display: flex;
flex-direction: column;
align-items: center;
.logo {
margin-bottom: 90px;
margin-top: 30px;
margin-bottom: 40px;
}
}