Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cesium-frame
Overview
Overview
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
jlc
cesium-frame
Commits
992d680b
Commit
992d680b
authored
Jul 16, 2024
by
jlc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update:锚点功能的添加,点击子菜单跳转到对应的内容区域
parent
9fbbfaeb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
56 additions
and
22 deletions
+56
-22
AsideMenuBar.vue
src/components/AsideMenuBar.vue
+12
-4
ElementMap.js
src/views/ElementMap.js
+37
-12
indexView.vue
src/views/indexView.vue
+7
-6
No files found.
src/components/AsideMenuBar.vue
View file @
992d680b
<
template
>
<
template
>
<el-aside>
<el-aside>
<el-scrollbar>
<el-scrollbar>
<el-menu
router
unique-opened
:collapse=
"isCollapse"
>
<el-menu
unique-opened
:collapse=
"isCollapse"
>
<a
href=
"/"
class=
"logo"
>
<a
href=
"/"
class=
"logo"
>
<img
src=
"@/assets/vue.svg"
alt=
""
>
<img
src=
"@/assets/vue.svg"
alt=
""
>
<h1>
Cesium
</h1>
<h1>
Cesium
</h1>
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
<el-icon><MapLocation
/></el-icon>
<el-icon><MapLocation
/></el-icon>
<span>
点的案例
</span>
<span>
点的案例
</span>
</
template
>
</
template
>
<el-menu-item
v-for=
"item in elementPointData"
:key=
"item.id"
index=
"pointOne
"
>
<el-menu-item
v-for=
"item in elementPointData"
:key=
"item.id"
@
click=
"goAnchor(item.title)
"
>
<el-icon><View
/></el-icon>
<el-icon><View
/></el-icon>
<span>
{{item.title}}
</span>
<span>
{{item.title}}
</span>
</el-menu-item>
</el-menu-item>
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
<el-icon><SemiSelect
/></el-icon>
<el-icon><SemiSelect
/></el-icon>
<span>
线的案例
</span>
<span>
线的案例
</span>
</
template
>
</
template
>
<el-menu-item
v-for=
"item in elementLineData"
:key=
"item.id"
index=
"lineOne
"
>
<el-menu-item
v-for=
"item in elementLineData"
:key=
"item.id"
@
click=
"goAnchor(item.title)
"
>
<el-icon><View
/></el-icon>
<el-icon><View
/></el-icon>
<span>
{{item.title}}
</span>
<span>
{{item.title}}
</span>
</el-menu-item>
</el-menu-item>
...
@@ -33,7 +33,7 @@
...
@@ -33,7 +33,7 @@
<el-icon><Grid
/></el-icon>
<el-icon><Grid
/></el-icon>
<span>
面的案例
</span>
<span>
面的案例
</span>
</
template
>
</
template
>
<el-menu-item
v-for=
"item in elementPlaneData"
:key=
"item.id"
index=
"planeOne
"
>
<el-menu-item
v-for=
"item in elementPlaneData"
:key=
"item.id"
@
click=
"goAnchor(item.title)
"
>
<el-icon><View
/></el-icon>
<el-icon><View
/></el-icon>
<span>
{{item.title}}
</span>
<span>
{{item.title}}
</span>
</el-menu-item>
</el-menu-item>
...
@@ -61,6 +61,14 @@ const props = defineProps({
...
@@ -61,6 +61,14 @@ const props = defineProps({
type
:
Boolean
,
type
:
Boolean
,
}
}
});
});
// 锚点定位跳转
function
goAnchor
(
title
)
{
var
anchor
=
document
.
getElementById
(
title
);
if
(
anchor
)
{
anchor
.
scrollIntoView
({
behavior
:
'smooth'
});
}
}
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
...
...
src/views/ElementMap.js
View file @
992d680b
export
const
elementPointMap
=
{
export
const
elementPointMap
=
{
One
:
{
One
:
{
title
:
'One'
,
title
:
'
point
One'
,
pngUrl
:
'/src/assets/PointOne.png'
pngUrl
:
'/src/assets/PointOne.png'
},
},
Two
:
{
Two
:
{
title
:
'Two'
,
title
:
'
point
Two'
,
pngUrl
:
'/src/assets/PointOne.png'
pngUrl
:
'/src/assets/PointOne.png'
},
},
Three
:
{
Three
:
{
title
:
'Three'
,
title
:
'
point
Three'
,
pngUrl
:
'/src/assets/PointOne.png'
pngUrl
:
'/src/assets/PointOne.png'
},
},
Four
:
{
Four
:
{
title
:
'Four'
,
title
:
'pointFour'
,
pngUrl
:
'/src/assets/PointOne.png'
},
Five
:
{
title
:
'pointFive'
,
pngUrl
:
'/src/assets/PointOne.png'
},
Six
:
{
title
:
'pointSix'
,
pngUrl
:
'/src/assets/PointOne.png'
pngUrl
:
'/src/assets/PointOne.png'
}
}
}
}
export
const
elementLineMap
=
{
export
const
elementLineMap
=
{
One
:
{
One
:
{
title
:
'One'
,
title
:
'
line
One'
,
pngUrl
:
'/src/assets/LineOne.png'
pngUrl
:
'/src/assets/LineOne.png'
},
},
Two
:
{
Two
:
{
title
:
'Two'
,
title
:
'
line
Two'
,
pngUrl
:
'/src/assets/LineOne.png'
pngUrl
:
'/src/assets/LineOne.png'
},
},
Three
:
{
Three
:
{
title
:
'Three'
,
title
:
'
line
Three'
,
pngUrl
:
'/src/assets/LineOne.png'
pngUrl
:
'/src/assets/LineOne.png'
},
},
Four
:
{
Four
:
{
title
:
'Four'
,
title
:
'lineFour'
,
pngUrl
:
'/src/assets/LineOne.png'
},
Five
:
{
title
:
'lineFive'
,
pngUrl
:
'/src/assets/LineOne.png'
},
Six
:
{
title
:
'lineSix'
,
pngUrl
:
'/src/assets/LineOne.png'
pngUrl
:
'/src/assets/LineOne.png'
}
}
}
}
export
const
elementPlaneMap
=
{
export
const
elementPlaneMap
=
{
One
:
{
One
:
{
title
:
'One'
,
title
:
'
plane
One'
,
pngUrl
:
'/src/assets/PlaneOne.png'
pngUrl
:
'/src/assets/PlaneOne.png'
},
},
Two
:
{
Two
:
{
title
:
'Two'
,
title
:
'
plane
Two'
,
pngUrl
:
'/src/assets/PlaneOne.png'
pngUrl
:
'/src/assets/PlaneOne.png'
},
},
Three
:
{
Three
:
{
title
:
'Three'
,
title
:
'
plane
Three'
,
pngUrl
:
'/src/assets/PlaneOne.png'
pngUrl
:
'/src/assets/PlaneOne.png'
},
},
Four
:
{
Four
:
{
title
:
'Four'
,
title
:
'planeFour'
,
pngUrl
:
'/src/assets/PlaneOne.png'
},
Five
:
{
title
:
'planeFive'
,
pngUrl
:
'/src/assets/PlaneOne.png'
},
Six
:
{
title
:
'planeSix'
,
pngUrl
:
'/src/assets/PlaneOne.png'
pngUrl
:
'/src/assets/PlaneOne.png'
}
}
}
}
\ No newline at end of file
src/views/indexView.vue
View file @
992d680b
...
@@ -3,8 +3,8 @@
...
@@ -3,8 +3,8 @@
<div
class=
"mt-5"
>
<div
class=
"mt-5"
>
<span
class=
"text-base font-bold"
>
点的案例
</span>
<span
class=
"text-base font-bold"
>
点的案例
</span>
<div
style=
"overflow-y: auto"
class=
"container"
>
<div
style=
"overflow-y: auto"
class=
"container"
>
<div
v-for=
"item in elementPointData"
:key=
"item.id"
@
click=
"indexBtn(`
point
$
{item.title}`)" class="item-container">
<div
v-for=
"item in elementPointData"
:key=
"item.id"
@
click=
"indexBtn(`$
{item.title}`)" class="item-container">
<div>
{{
item
.
title
}}
</div>
<div
:id=
"item.title"
>
{{
item
.
title
}}
</div>
<img
:src=
"item.pngUrl"
width=
"250"
>
<img
:src=
"item.pngUrl"
width=
"250"
>
</div>
</div>
</div>
</div>
...
@@ -12,8 +12,8 @@
...
@@ -12,8 +12,8 @@
<div
class=
"mt-10"
>
<div
class=
"mt-10"
>
<span
class=
"text-base font-bold"
>
线的案例
</span>
<span
class=
"text-base font-bold"
>
线的案例
</span>
<div
style=
"overflow-y: auto"
class=
"container"
>
<div
style=
"overflow-y: auto"
class=
"container"
>
<div
v-for=
"item in elementLineData"
:key=
"item.id"
@
click=
"indexBtn(`
line
$
{item.title}`)" class="item-container">
<div
v-for=
"item in elementLineData"
:key=
"item.id"
@
click=
"indexBtn(`$
{item.title}`)" class="item-container">
<div>
{{
item
.
title
}}
</div>
<div
:id=
"item.title"
>
{{
item
.
title
}}
</div>
<img
:src=
"item.pngUrl"
width=
"250"
>
<img
:src=
"item.pngUrl"
width=
"250"
>
</div>
</div>
</div>
</div>
...
@@ -21,8 +21,8 @@
...
@@ -21,8 +21,8 @@
<div
class=
"mt-10"
>
<div
class=
"mt-10"
>
<span
class=
"text-base font-bold"
>
面的案例
</span>
<span
class=
"text-base font-bold"
>
面的案例
</span>
<div
style=
"overflow-y: auto"
class=
"container"
>
<div
style=
"overflow-y: auto"
class=
"container"
>
<div
v-for=
"item in elementPlaneData"
:key=
"item.id"
@
click=
"indexBtn(`
plane
$
{item.title}`)" class="item-container">
<div
v-for=
"item in elementPlaneData"
:key=
"item.id"
@
click=
"indexBtn(`$
{item.title}`)" class="item-container">
<div>
{{
item
.
title
}}
</div>
<div
:id=
"item.title"
>
{{
item
.
title
}}
</div>
<img
:src=
"item.pngUrl"
width=
"250"
>
<img
:src=
"item.pngUrl"
width=
"250"
>
</div>
</div>
</div>
</div>
...
@@ -44,6 +44,7 @@ elementPointData.value = elementPointMap;
...
@@ -44,6 +44,7 @@ elementPointData.value = elementPointMap;
elementLineData
.
value
=
elementLineMap
;
elementLineData
.
value
=
elementLineMap
;
elementPlaneData
.
value
=
elementPlaneMap
;
elementPlaneData
.
value
=
elementPlaneMap
;
// 跳转到对应的编码编辑内容
function
indexBtn
(
id
)
{
function
indexBtn
(
id
)
{
router
.
push
(
`/CodeAndCesium/?id=
${
id
}
`
)
router
.
push
(
`/CodeAndCesium/?id=
${
id
}
`
)
}
}
...
...
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