Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
vridge-docs
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
JIRA
JIRA
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Gyeongho Park
vridge-docs
Commits
0f07ff72
Commit
0f07ff72
authored
Feb 22, 2023
by
shj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ADD] nav active 기능 개선
- 페이지 로드 시 nav 활성화 - 'tree' component 템플릿 구조 변경(v-list 삭제, sub-group 적용 등)
parent
84e1ca6e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
46 deletions
+55
-46
guide.scss
docs-front/assets/scss/guide.scss
+3
-9
tree.vue
docs-front/components/tree.vue
+14
-11
default.vue
docs-front/layouts/default.vue
+38
-26
No files found.
docs-front/assets/scss/guide.scss
View file @
0f07ff72
...
@@ -177,23 +177,17 @@
...
@@ -177,23 +177,17 @@
.navigation-wrap
{
.navigation-wrap
{
overflow-x
:
hidden
;
overflow-x
:
hidden
;
border-right
:
1px
solid
rgba
(
0
,
0
,
0
,
0
.05
)
!
important
;
border-right
:
1px
solid
rgba
(
0
,
0
,
0
,
0
.05
)
!
important
;
.v-list-item
{
.v-list-item
{
*
{
*
{
font-size
:
14px
!
important
;
font-size
:
14px
!
important
;
}
}
&
.active
{
&
.active
,
&
.v-list-item--active
{
*
{
*
{
font-weight
:
bold
!
important
;
font-weight
:
bold
!
important
;
color
:
#1E88E5
;
color
:
#1E88E5
;
}
}
&
.theme--dark
{
background-color
:
rgba
(
128
,
128
,
128
,
0
.07
)
!
important
;
background-color
:
rgba
(
128
,
128
,
128
,
0
.07
)
!
important
;
}
&
.theme--light
{
background-color
:
rgba
(
128
,
128
,
128
,
0
.07
)
!
important
;
}
}
&
:
:
before
{
}
}
}
}
...
...
docs-front/components/tree.vue
View file @
0f07ff72
<
template
>
<
template
>
<div
v-if=
"items"
>
<div>
<
v-list
<
div
v-for=
"(item, i) in items"
v-for=
"(item, i) in items"
:key=
"`guide-$
{item.title}-${i}`"
:key=
"`guide-$
{item.title}-${i}`"
:class="depth > 1 ? `ml-${depth*2}` : ''"
:class="depth > 1 ? `ml-${depth*2}` : ''"
...
@@ -9,25 +9,29 @@
...
@@ -9,25 +9,29 @@
<v-list-item
<v-list-item
v-if=
"item.children.length === 0"
v-if=
"item.children.length === 0"
@
click=
"clickChildEvent(item)"
@
click=
"clickChildEvent(item)"
v-model=
"item.active"
:ripple=
"false"
:ripple=
"false"
active-class=
"active
"
:class=
"isActiveMenu(item.id) ? 'active' : ''
"
:style=
"isActiveMenu(item.id) ? 'border-left:
2px solid #1E88E5;' : 'border-left:
1px solid rgba(0,0,0,0.15);'"
:style=
"isActiveMenu(item.id) ? 'border-left:
2px solid #1E88E5;' : 'border-left:
1px solid rgba(0,0,0,0.15);'"
>
>
<v-list-item-title
v-text=
"item.title"
/>
<v-list-item-title
v-text=
"item.title"
/>
</v-list-item>
</v-list-item>
<v-list-group
<v-list-group
v-else
v-else
:ripple=
"false"
v-model=
"item.active"
v-model=
"item.active"
active-class=
"active"
:ripple=
"false"
:style=
"isActiveMenu(item.id) ? 'border-left:2px solid #1E88E5;' : 'border-left:1px solid rgba(0,0,0,0.15);'"
:class=
"isActiveMenu(item.id) ? 'active' : ''"
:sub-group=
"depth > 1 ? true : false"
:style=
"isActiveMenu(item.id) ? 'border-left: 2px solid #1E88E5;' : 'border-left: 1px solid rgba(0,0,0,0.15);'"
prepend-icon=
""
>
>
<template
v-slot:appendIcon
>
<v-icon>
mdi-chevron-down
</v-icon>
</
template
>
<
template
v-slot:activator
>
<
template
v-slot:activator
>
<v-list-item-content
<v-list-item-content
v-if=
"item"
v-if=
"item"
v-model=
"item.active"
@
click=
"clickParentEvent(item)"
@
click=
"clickParentEvent(item)"
active-class=
"active"
active-class=
"active"
>
>
...
@@ -42,8 +46,7 @@
...
@@ -42,8 +46,7 @@
@
clickChildEvent=
"clickChildEvent"
@
clickChildEvent=
"clickChildEvent"
/>
/>
</v-list-group>
</v-list-group>
</v-list>
</div>
</div>
</div>
</template>
</template>
...
...
docs-front/layouts/default.vue
View file @
0f07ff72
...
@@ -61,14 +61,15 @@
...
@@ -61,14 +61,15 @@
<v-list-item-title>
홈
</v-list-item-title>
<v-list-item-title>
홈
</v-list-item-title>
</v-list-item>
</v-list-item>
</v-list>
</v-list>
<tree
<v-list
v-if=
"guideIndex && !loadingPageList"
>
v-if=
"guideIndex"
<tree
:items=
"guideIndex"
:items=
"guideIndex"
@
clickParentEvent=
"openGuide"
@
clickParentEvent=
"openGuide"
@
clickChildEvent=
"openGuide"
@
clickChildEvent=
"openGuide"
/>
/>
</v-list>
<template
v-slot:prepend
>
<template
v-slot:prepend
>
<v-row
no-gutters
align=
"center"
justify=
"center"
@
click=
"logoEvent()"
class=
" modile-logo-wrap my-4"
>
<v-row
no-gutters
align=
"center"
justify=
"center"
@
click=
"logoEvent()"
class=
" modile-logo-wrap my-4"
>
<NuxtLink
to=
"/"
>
<NuxtLink
to=
"/"
>
...
@@ -203,7 +204,6 @@ export default{
...
@@ -203,7 +204,6 @@ export default{
currentNavIndex
:
0
,
currentNavIndex
:
0
,
keyword
:
''
,
keyword
:
''
,
drawer
:
true
,
drawer
:
true
,
guideTitle
:
''
,
clipped
:
false
,
clipped
:
false
,
rawIndexList
:[],
rawIndexList
:[],
guideIndex
:[],
guideIndex
:[],
...
@@ -247,23 +247,6 @@ export default{
...
@@ -247,23 +247,6 @@ export default{
this
.
$router
.
push
(
'/'
+
guide
.
id
)
this
.
$router
.
push
(
'/'
+
guide
.
id
)
},
},
// async getGuideIndex() {
// this.loadingPageList = true
// await this.$axios.get('http://localhost:5000/api/index')
// .then(res => {
// this.guideIndex = res.data
// // console.log('guideIndex : ', res.data)
// })
// .catch(err => {
// console.log(err)
// })
// this.loadingPageList = false
// this.activeGuideTreeIndex()
// },
async
getGuideIndex
(){
async
getGuideIndex
(){
this
.
loadingPageList
=
true
this
.
loadingPageList
=
true
...
@@ -299,6 +282,7 @@ export default{
...
@@ -299,6 +282,7 @@ export default{
console
.
log
(
err
)
console
.
log
(
err
)
})
})
this
.
activeNav
()
this
.
loadingPageList
=
false
this
.
loadingPageList
=
false
// this.activeGuideTreeIndex(this.guideIndex)
// this.activeGuideTreeIndex(this.guideIndex)
},
},
...
@@ -481,6 +465,34 @@ export default{
...
@@ -481,6 +465,34 @@ export default{
coloredText
.
innerHTML
=
this
.
keyword
coloredText
.
innerHTML
=
this
.
keyword
coloredText
.
style
.
color
=
'#1e88e5'
coloredText
.
style
.
color
=
'#1e88e5'
return
text
.
replaceAll
(
this
.
keyword
,
container
.
innerHTML
)
return
text
.
replaceAll
(
this
.
keyword
,
container
.
innerHTML
)
},
activeNav
(){
let
path
=
''
this
.
rawIndexList
.
forEach
(
guide
=>
{
if
(
guide
.
id
===
this
.
$route
.
params
.
guide
){
path
=
guide
.
path
}
})
let
activeTargetPaths
=
[]
let
index
=
0
// 활성화 해야할 guide path 배열 생성
while
(
path
.
indexOf
(
'/'
,
index
+
1
)
>
-
1
)
{
index
=
path
.
indexOf
(
'/'
,
index
+
1
)
activeTargetPaths
.
push
(
path
.
substr
(
0
,
index
+
1
))
}
// 활성화
let
guideList
=
this
.
guideIndex
for
(
let
i
=
0
;
i
<
activeTargetPaths
.
length
;
++
i
){
for
(
let
j
=
0
;
j
<
guideList
.
length
;
++
j
){
if
(
guideList
[
j
].
path
===
activeTargetPaths
[
i
]){
guideList
[
j
].
active
=
true
guideList
=
guideList
[
j
].
children
}
}
}
}
}
},
},
mounted
(){
mounted
(){
...
...
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