Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
liyeyun
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cfld-frontend
liyeyun
Commits
1b472073
Commit
1b472073
authored
Dec 15, 2023
by
王玉鑫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 菜单项选中状态修改
parent
ada8249e
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
5 deletions
+26
-5
App.vue
src/App.vue
+6
-2
router.ts
src/router/router.ts
+18
-3
typings.d.ts
src/types/typings.d.ts
+2
-0
No files found.
src/App.vue
View file @
1b472073
...
@@ -62,8 +62,12 @@ const menuList = computed(() => {
...
@@ -62,8 +62,12 @@ const menuList = computed(() => {
* 当前菜单path
* 当前菜单path
*/
*/
const
currentPath
=
computed
(()
=>
{
const
currentPath
=
computed
(()
=>
{
if
(
`#
${
route
.
path
}
`
===
window
.
location
.
hash
)
{
const
{
menuRouteName
}
=
route
.
meta
;
return
route
.
path
;
const
{
fullPath
,
path
}
=
route
;
if
(
menuRouteName
)
{
return
router
.
resolve
({
name
:
menuRouteName
}).
path
;
}
else
if
(
router
.
resolve
(
fullPath
).
href
===
window
.
location
.
hash
)
{
return
path
;
}
else
{
}
else
{
return
''
;
return
''
;
}
}
...
...
src/router/router.ts
View file @
1b472073
...
@@ -160,6 +160,9 @@ const routes: readonly RouteRecordRaw[] = [
...
@@ -160,6 +160,9 @@ const routes: readonly RouteRecordRaw[] = [
// 产业政策详情
// 产业政策详情
...
gen
(
RouteName
.
industryPolicyDetail
),
...
gen
(
RouteName
.
industryPolicyDetail
),
component
:
IndustryPolicyDetail
,
component
:
IndustryPolicyDetail
,
meta
:
{
menuRouteName
:
RouteName
.
industryPolicy
,
},
},
},
{
{
// 地图选址
// 地图选址
...
@@ -172,7 +175,7 @@ const routes: readonly RouteRecordRaw[] = [
...
@@ -172,7 +175,7 @@ const routes: readonly RouteRecordRaw[] = [
component
:
AboutUs
,
component
:
AboutUs
,
},
},
{
{
//
关于立业云
//
联系我们
...
gen
(
RouteName
.
contactUs
),
...
gen
(
RouteName
.
contactUs
),
component
:
ContactUs
,
component
:
ContactUs
,
},
},
...
@@ -185,21 +188,33 @@ const routes: readonly RouteRecordRaw[] = [
...
@@ -185,21 +188,33 @@ const routes: readonly RouteRecordRaw[] = [
// 产业园详情
// 产业园详情
...
gen
(
RouteName
.
industrialParkDetail
),
...
gen
(
RouteName
.
industrialParkDetail
),
component
:
IndustrialParkDetail
,
component
:
IndustrialParkDetail
,
meta
:
{
menuRouteName
:
RouteName
.
industrialParkList
,
},
},
},
{
{
// 开发区详情
// 开发区详情
...
gen
(
RouteName
.
developZoneDetail
),
...
gen
(
RouteName
.
developZoneDetail
),
component
:
DevelopZoneDetail
,
component
:
DevelopZoneDetail
,
meta
:
{
menuRouteName
:
RouteName
.
developZoneList
,
},
},
},
{
{
//
开发区
详情
//
土地
详情
...
gen
(
RouteName
.
landDetail
),
...
gen
(
RouteName
.
landDetail
),
component
:
LandDetail
,
component
:
LandDetail
,
meta
:
{
menuRouteName
:
RouteName
.
landList
,
},
},
},
{
{
//
开发区
详情
//
载体
详情
...
gen
(
RouteName
.
carrierDetail
),
...
gen
(
RouteName
.
carrierDetail
),
component
:
CarrierDetail
,
component
:
CarrierDetail
,
meta
:
{
menuRouteName
:
RouteName
.
carrierList
,
},
},
},
{
{
// 用户中心
// 用户中心
...
...
src/types/typings.d.ts
View file @
1b472073
import
'vue-router'
;
import
'vue-router'
;
import
{
RouteName
}
from
'@/router/router.ts'
;
declare
module
'vue-router'
{
declare
module
'vue-router'
{
interface
RouteMeta
{
interface
RouteMeta
{
menuName
?:
string
;
menuName
?:
string
;
parentMenuName
?:
string
;
parentMenuName
?:
string
;
menuRouteName
?:
RouteName
;
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment