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
465eea8a
Commit
465eea8a
authored
Feb 25, 2023
by
shj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[MOD] 가이드 홈 페이지 스타일 정리
- 좌측에 nav bar가 없을 경우에만 메인 섹션에 목차 로드
parent
48aae8f1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
42 deletions
+61
-42
tree.vue
docs-front/components/tree.vue
+7
-1
index.vue
docs-front/pages/index.vue
+54
-41
No files found.
docs-front/components/tree.vue
View file @
465eea8a
<
template
>
<
template
>
<div>
<div
class=
"tree-container"
>
<div
<div
v-for=
"(item, i) in items"
v-for=
"(item, i) in items"
:key=
"`guide-$
{item.title}-${i}`"
:key=
"`guide-$
{item.title}-${i}`"
...
@@ -80,3 +80,9 @@ export default {
...
@@ -80,3 +80,9 @@ export default {
},
},
}
}
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
.tree-container
{
width
:
100%
;
}
</
style
>
\ No newline at end of file
docs-front/pages/index.vue
View file @
465eea8a
<
template
>
<
template
>
<div
class=
"guide-wrap-container"
>
<div
class=
"guide-wrap-container"
>
<v-container
class=
"guide-wrap"
>
<v-container
class=
"guide-wrap"
>
<v-row
no-gutters
align=
"center"
justify=
"center"
class=
"guide-wrap-header"
>
<v-row
no-gutters
align=
"center"
justify=
"center"
class=
"guide-wrap-header"
>
<h1
class=
"font-weight-bold"
>
서비스 가이드
</h1>
<h1
class=
"font-weight-bold"
>
서비스 가이드
</h1>
</v-row>
</v-row>
<v-row
no-gutters
class=
"guide-content"
>
<v-row
no-gutters
class=
"guide-content"
>
<v-col
cols=
"12"
align=
"center"
justify=
"center"
class=
"mt-8"
>
<v-col
cols=
"12"
align=
"center"
justify=
"center"
class=
"ma-auto"
>
브릿지 AI 플랫폼에서 제공하는 서비스를 사용하는 방법을 설명합니다.
<img
src=
"/logo_v2/s01.png"
cover
/>
<p>
AI를 손쉽게 개발할 수 있는 플랫폼,
<br>
브릿지 사용 방법을 소개합니다.
</p>
<v-list
v-if=
"guideIndex"
class=
"d-md-flex d-lg-none"
>
<tree
:items=
"guideIndex"
@
clickItemEvent=
"openGuide"
/>
</v-list>
</v-col>
</v-col>
<v-card
style=
"width:100%;"
flat
color=
"transparent"
class=
"px-4"
>
<v-divider
class=
"my-12"
/>
<v-col
cols=
"12"
class=
"my-4"
><h3
class=
"font-weight-bold"
>
목차
</h3></v-col>
<v-treeview
:items=
"guideIndex"
item-text=
"title"
>
<template
v-slot:label=
"
{ item }">
<a
@
click=
"openGuide(item)"
>
{{
item
.
title
}}
</a>
</
template
>
</v-treeview>
</v-card>
</v-row>
</v-row>
</v-container>
</v-container>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
export
default
{
export
default
{
layout
:
'guide'
,
layout
:
'guide'
,
data
:()
=>
({
data
:()
=>
({
guideIndex
:
[]
guideIndex
:
[]
,
}),
}),
methods
:{
methods
:{
getGuideIndex
()
{
async
getGuideIndex
(){
this
.
$store
.
state
.
guideId
=
null
await
this
.
$axios
.
get
(
'http://localhost:5000/guide-index/all'
)
this
.
$store
.
commit
(
'setGuide'
,
{
guideId
:
null
,
flag
:
false
})
this
.
$axios
.
get
(
'http://localhost:5000/test/index'
)
.
then
(
res
=>
{
.
then
(
res
=>
{
this
.
g
uideIndex
=
res
.
data
this
.
g
etIndexTree
(
JSON
.
parse
(
JSON
.
stringify
(
res
.
data
)));
})
})
.
catch
(
err
=>
{
.
catch
(
err
=>
{
console
.
log
(
err
)
console
.
log
(
err
)
})
})
},
},
getIndexTree
(
unclassifiedList
){
let
indexTree
=
[]
// depth 1 리스트 생성
unclassifiedList
.
forEach
(
el
=>
{
if
(
el
.
depth
===
1
){
indexTree
.
push
(
el
)
delete
unclassifiedList
[
unclassifiedList
.
indexOf
(
el
)]
}
})
openGuide
(
guide
)
{
// depth 2 이상인 인덱스들 트리구조 생성
this
.
$router
.
push
(
'/'
+
this
.
parsingContentTitle
(
guide
)
)
this
.
setTreeChild
(
indexTree
,
unclassifiedList
)
this
.
$store
.
commit
(
'setGuide'
,
{
guideId
:
guide
.
id
,
flag
:
true
})
this
.
$store
.
state
.
guideId
=
guide
.
id
this
.
guideIndex
=
JSON
.
parse
(
JSON
.
stringify
(
indexTree
))
},
},
setTreeChild
(
targetList
,
unclassifiedList
){
parsingContentTitle
(
content
)
{
targetList
.
forEach
(
el
=>
{
let
keyArray
=
content
.
contentKey
.
replace
(
'.md'
,
''
).
split
(
'/'
)
el
.
children
=
[]
let
titleKey
=
''
if
(
keyArray
[
0
]
!==
keyArray
[
1
])
{
unclassifiedList
.
forEach
(
ucsfEl
=>
{
for
(
let
i
=
0
;
i
<
keyArray
.
length
-
1
;
i
++
)
{
if
(
ucsfEl
.
path
.
indexOf
(
el
.
path
)
>
-
1
&&
ucsfEl
.
depth
===
el
.
depth
+
1
){
titleKey
+=
keyArray
[
i
]
+
'_'
el
.
children
.
push
(
ucsfEl
)
delete
unclassifiedList
[
unclassifiedList
.
indexOf
(
ucsfEl
)]
}
})
if
(
el
.
children
.
length
>
0
){
this
.
setTreeChild
(
el
.
children
,
unclassifiedList
)
}
}
titleKey
+=
content
.
title
})
}
else
{
},
titleKey
=
content
.
title
openGuide
(
guide
)
{
}
this
.
$router
.
push
(
'/'
+
guide
.
id
)
return
titleKey
},
},
},
},
mounted
(){
mounted
(){
this
.
getGuideIndex
()
this
.
getGuideIndex
()
},
},
watch
:{
watch
:{
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.guide-content
{
.v-list
{
max-width
:
400px
;
text-align
:
left
;
margin-top
:
20px
!
important
;
}
}
}
</
script
>
</
style
>
\ No newline at end of file
\ No newline at end of file
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