Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx-business
/
website-middleground
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit a49e0935
authored
Oct 18, 2024
by
胡悦
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
提交优化
1 parent
78cc3786
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
36 deletions
src/App.vue
src/components/Menu/index.vue
src/router/routes.ts
src/App.vue
View file @
a49e093
...
@@ -11,29 +11,8 @@ import Menu from '@/components/Menu/index.vue';
...
@@ -11,29 +11,8 @@ import Menu from '@/components/Menu/index.vue';
</
script
>
</
script
>
<
template
>
<
template
>
<div
class=
"layout"
>
<a-layout>
<a-layout-header><NavBar
/></a-layout-header>
<a-layout>
<a-layout-sider>
<Menu
/>
</a-layout-sider>
<a-layout-content
class=
"content"
>
<router-view></router-view>
<router-view></router-view>
</a-layout-content>
</a-layout>
</a-layout>
</div>
</
template
>
</
template
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
.content
{
box-sizing
:
border-box
;
width
:
100%
;
height
:
calc
(
100vh
-
48px
);
background-color
:
#f7f8f9
;
box-sizing
:
border-box
;
padding
:
16px
20px
;
overflow-y
:
auto
}
</
style
>
</
style
>
\ No newline at end of file
\ No newline at end of file
src/components/Menu/index.vue
View file @
a49e093
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
* @Author: huyue
* @Author: huyue
* @Date: 2024-07-24 20:28:10
* @Date: 2024-07-24 20:28:10
* @LastEditors: huyue
* @LastEditors: huyue
* @LastEditTime: 2024-10-1
7 17:38:27
* @LastEditTime: 2024-10-1
8 16:02:45
-->
-->
<
script
lang=
"ts"
setup
>
<
script
lang=
"ts"
setup
>
...
@@ -14,15 +14,11 @@ import { useRouter, useRoute } from 'vue-router';
...
@@ -14,15 +14,11 @@ import { useRouter, useRoute } from 'vue-router';
const
router
=
useRouter
();
const
router
=
useRouter
();
const
route
=
useRoute
();
const
route
=
useRoute
();
let
defaultSelectedKeys
=
ref
([
''
]);
let
defaultSelectedKeys
=
ref
([
''
]);
const
menuList
=
ref
(
staticRoutes
.
filter
(
item
=>
item
.
isMenu
));
const
routerList
=
staticRoutes
.
find
(
item
=>
item
.
path
===
'/layout'
)?.
children
;
const
menuList
=
ref
(
routerList
!
.
filter
(
item
=>
item
.
isMenu
));
onBeforeMount
(()
=>
{
onBeforeMount
(()
=>
{
console
.
log
(
route
)
const
_parentPath
=
routerList
!
.
find
(
item
=>
item
.
path
===
route
.
path
)?.
parentPath
if
(
route
.
path
==
'/login'
)
{
defaultSelectedKeys
.
value
=
_parentPath
===
undefined
?
[
'/investorRelated'
]
:
[
_parentPath
]
defaultSelectedKeys
.
value
=
[
'/investorRelated'
]
}
else
{
const
_parentPath
=
staticRoutes
.
find
(
item
=>
item
.
path
===
route
.
path
)?.
parentPath
defaultSelectedKeys
.
value
=
[
_parentPath
]
}
})
})
</
script
>
</
script
>
<
template
>
<
template
>
...
...
src/router/routes.ts
View file @
a49e093
...
@@ -17,6 +17,10 @@ const staticRoutes = Object.freeze([
...
@@ -17,6 +17,10 @@ const staticRoutes = Object.freeze([
component
:
()
=>
import
(
'views/login/index.vue'
),
component
:
()
=>
import
(
'views/login/index.vue'
),
},
},
{
{
path
:
'/layout'
,
component
:
()
=>
import
(
'views/layout/index.vue'
),
children
:
[
{
id
:
'1'
,
id
:
'1'
,
name
:
'投资者相关'
,
name
:
'投资者相关'
,
path
:
'/investorRelated'
,
path
:
'/investorRelated'
,
...
@@ -48,10 +52,6 @@ const staticRoutes = Object.freeze([
...
@@ -48,10 +52,6 @@ const staticRoutes = Object.freeze([
component
:
()
=>
import
(
'views/news/AddNews.vue'
),
component
:
()
=>
import
(
'views/news/AddNews.vue'
),
}
}
// {
// {
// path: '/layout',
// component: () => import('views/layout/index.vue'),
// children: [
// {
// name: '投资者相关',
// name: '投资者相关',
// path: '/layout/investorRelated',
// path: '/layout/investorRelated',
// component: () => import('views/investorRelated/index.vue')
// component: () => import('views/investorRelated/index.vue')
...
@@ -66,7 +66,7 @@ const staticRoutes = Object.freeze([
...
@@ -66,7 +66,7 @@ const staticRoutes = Object.freeze([
// path: '/layout/news',
// path: '/layout/news',
// component: () => import('views/news/index.vue'),
// component: () => import('views/news/index.vue'),
// }
// }
//
]
]
//
},
},
])
])
export
default
staticRoutes
export
default
staticRoutes
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment