Commit 04ca0d0b authored by Gyeongho Park's avatar Gyeongho Park

[REFACTOR] 불필요 코드 정리

parent e0d7ec96
@charset "utf-8";
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;700;900&display=swap'); @import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;700;900&display=swap');
.v-application{ .guide-app {
&.default-guide-wrap{
//background-color: #fff !important;
}
}
.default-guide-wrap {
//background-color: #fff !important;
overflow-x: hidden; overflow-x: hidden;
font-size: 16px !important; font-size: 16px !important;
*{ *{
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
font-weight: 400; font-weight: 400;
letter-spacing: -0.25px;;
} }
.guide-wrap-container{ .guide-wrap-container{
padding-right: 240px; padding-right: 240px;
} }
.guide-wrap { .guide-wrap {
min-height: 100vh !important; min-height: 100vh !important;
max-width: 1280px !important; max-width: 1280px !important;
...@@ -117,11 +106,8 @@ ...@@ -117,11 +106,8 @@
} }
} }
.guide-navigator{ .guide-navigator{
display: block; display: block;
box-shadow: none !important; box-shadow: none !important;
min-width:230px; min-width:230px;
...@@ -179,7 +165,7 @@ ...@@ -179,7 +165,7 @@
box-shadow: 0 3px 9px rgba(0, 0, 0, 0.1); box-shadow: 0 3px 9px rgba(0, 0, 0, 0.1);
} }
} }
// navigation-drawer
.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;
......
<template>
<v-dialog
v-model="dialog"
:persistent="persistent"
scrollable
:max-width="maxWidth"
:max-height="maxHeight"
:width="width"
:fullscreen="fullDialog"
@keydown.enter="enterKeyEvent"
overlay-opacity="0.2"
transition="slide-y-reverse-transition"
content-class="vridge-dialog-container"
>
<template v-slot:activator="{on, attrs}">
<slot name="button" v-on="on" v-bind="{on, attrs}"></slot>
</template>
<v-card class="vridge-dialog" :tile="tile" elevation="0">
<v-card-title class="vridge-dialog-title">
<slot name="title" v-if="$slots.title">
</slot>
<v-row v-else no-gutters align="center">
<span class="font-weight-bold">
{{title}}
</span>
<v-spacer/>
<v-avatar size="28" class="vridge-dialog-close" v-if="closeButton">
<v-icon class="font-weight-bold" @click="clickNo" >mdi-close</v-icon>
</v-avatar>
</v-row>
</v-card-title>
<v-card-text class="vridge-content-container" color="white" flat :style="'height:' + height +'px !important; overflow-y:' + overflow + ';background:' + background" style="min-height:140px;">
<v-container fluid style="width:100%; height:100%;">
<slot name="content">
</slot>
</v-container>
</v-card-text>
<v-card-actions class="vridge_actions" v-if="!$slots.actionButton" >
<v-spacer></v-spacer>
<v-btn
:ripple="false"
elevation="0"
@click="clickNo"
:disabled="disabledNo"
:loading="loading"
>
<span>{{$t('close')}}</span>
</v-btn>
<v-btn
color="primary"
@click="clickYes"
elevation="0"
:ripple="false"
v-if="clickYesBtn"
:loading="loading"
:disabled="disabledYes"
>
<span>{{clickYesBtn}}</span>
</v-btn>
</v-card-actions>
<v-card-actions v-else class="vridge_actions">
<v-spacer/>
<slot name="actionButton"> </slot>
</v-card-actions>
</v-card>
</v-dialog>
</template>
<script>
export default {
name: 'vridgeDialog',
props: {
persistent:{
type:Boolean,
default:false
},
borderBottom:{
type:Number
},
borderRadius:{
type:Number
},
color:{
type:String
},
colorHeader:{
type:String
},
fullscreen:{
type:Boolean,
default:false
},
disabled:{
type: Boolean,
default: false
},
icon:{
type: String,
default: ''
},
title:{
type: String,
default: '새창'
},
width:{
type: Number,
default: 500
},
height:{
type: Number,
default: 120
},
maxWidth:{
type: Number,
default: 1080
},
maxHeight:{
type: Number,
default: 1080
},
padding:{
type:String
},
overflow:{
type:String,
default:'auto'
},
background:{
type:String
},
backgroundHeader:{
type:String
},
clickYesBtn:{
type:String,
default:""
},
mobileFull:{
type:Boolean,
default:false
},
enterKeyActive:{
type:Boolean,
default:false
},
tile:{
type:Boolean,
default:false
},
closeButton:{
type:Boolean,
default:false
},
loading: {
type:Boolean,
default:false
},
disabledYes: {
type:Boolean,
default:false
},
disabledNo: {
type:Boolean,
default:false
},
autoClose: {
type:Boolean,
default:true
}
},
data: () => ({
dialog: false,
format:'YYYY-MM-DD',
isFullDialog:false
}),
watch:{
dialog() {
this.$emit('change')
if(this.dialog) {
this.init()
if(this.mobileFull){
this.isFullDialog = window.innerWidth <= 768
}
} else {
this.$emit('click-no')
this.$emit('close')
}
},
},
computed: {
fullDialog(){
return this.isFullDialog || this.fullscreen
}
},
methods:{
init(){
},
clickYes(){
if(this.autoClose) this.dialog = false
this.$emit('click-yes')
},
enterKeyEvent(){
if(this.enterKeyActive){
this.$emit('click-yes')
}
},
select (index) {
this.selectedIndex = index
},
clickNo(){
this.dialog = false
this.$emit('click-no')
},
resizeEventHandler(e) {
if(this.dialog && this.mobileFull) {
if(e.currentTarget.outerWidth <= 768) {
this.isFullDialog = true
} else {
this.isFullDialog = false
}
} else {
this.isFullDialog = false
}
},
},
mounted(){
window.addEventListener("resize", this.resizeEventHandler);
},
destroyed() {
window.removeEventListener("resize", this.resizeEventHandler);
},
}
</script>
<style lang="scss">
.vridge-dialog-container{
.theme--light &{
box-shadow: rgba(0, 0, 0, 0.1) 0px 20px 30px !important;
}
}
.theme--dark{
.vridge-dialog{
border:1px solid #2a2a2a !important;
}
}
.theme--light{
.vridge-dialog{
border:1px solid #eee !important;
}
}
.vridge-dialog{
overflow-x:hidden;
padding:24px;
> .v-card__title{
font-size:20px !important;
padding:12px !important;
//margin-bottom:12px !important;
}
.vridge-content-container{
padding:0px !important;
font-size: 14px;
transition: height 0.5s ease-in-out;
}
.vridge_actions{
padding: 12px !important;
}
}
.create-slot-cover{
padding:0;
margin:0;
.search-menu-cover{
display:flex;
background-color:transparent;
border:1px solid #e0e0e0;
border-radius: 5px;
}
.search-menu-check-cover{
.v-input--selection-controls {
padding: 0;
margin: 0;
}
.v-messages {
display:none !important;
}
}
}
.v-dialog--persistent{
.vdp-datepicker, .vdpWithInput{
height:38px;
width:100%;
input{
height: 38px;
padding-left:12px;
width:100%;
font-size:15px;
}
.vdp-datepicker__calendar{
bottom: 40px;
}
}
}
.vdpClearInput{
display:none !important;
}
.dateInput >>> input{
padding:8px 0px;
font-size: 13px;
font-weight: 500;
opacity: .7;
}
.dateInput >>> button::before{
display:none !important;
}
.calendarCustom{
font-size:20px;
margin-left:-25px;
position:relative;
color:#4159b2;
cursor:pointer;
display:flex;
align-items:center;
}
/* .v-dialog{
overflow-y: initial;
}*/
.search-menu-cover{
.vdpHeader{
background:rgba(0,0,0,0.05) !important;
}
}
.vridge-dialog-close{
transition: all 0.2s ease-in-out;
opacity: 0.7;
&:hover{
transform:scale(1.1) !important;
opacity: 1.0;
.theme--dark{
background-color:#1b1c20 !important;
}
.theme--light{
background-color:#ccc !important;
}
font-weight: bold !important;
}
}
</style>
\ No newline at end of file
<template> <template>
<v-app class="default-guide-wrap"> <v-app class="guide-app">
<div class="no-shadow"> <div class="no-shadow">
<client-only> <client-only>
...@@ -57,9 +57,9 @@ ...@@ -57,9 +57,9 @@
> >
<v-list-item <v-list-item
:ripple="false" :ripple="false"
@click="[$router.push('/docs'), guideIndex.forEach((x)=>x.active = false)]" @click="[$router.push('/'), guideIndex.forEach((x)=>x.active = false)]"
active-class="active" active-class="active"
:class="{active: $route.path === '/docs'}" :class="{active: $route.path === '/'}"
> >
<v-list-item-title></v-list-item-title> <v-list-item-title></v-list-item-title>
</v-list-item> </v-list-item>
...@@ -96,7 +96,7 @@ ...@@ -96,7 +96,7 @@
<template v-slot:activator> <template v-slot:activator>
<v-list-item-content @click="openGuide(item, item.title)"> <v-list-item-content @click="openGuide(item, item.title)">
<v-list-item-title v-text="$t('guide_title_' + item.title)"></v-list-item-title> <v-list-item-title v-text="item.title"></v-list-item-title>
</v-list-item-content> </v-list-item-content>
...@@ -131,7 +131,7 @@ ...@@ -131,7 +131,7 @@
<template v-slot:activator> <template v-slot:activator>
<v-list-item-content @click="openGuide(subItem, item.title + '_' + subItem.title)"> <v-list-item-content @click="openGuide(subItem, item.title + '_' + subItem.title)">
<v-list-item-title v-text="$t('guide_title_' + item.title+ '_' + subItem.title)"></v-list-item-title> <v-list-item-title v-text="subItem.title"></v-list-item-title>
</v-list-item-content> </v-list-item-content>
<v-btn small icon v-if="$store.state.editMode" @click="removeGuide(subItem.id)"><v-icon>mdi-close</v-icon></v-btn> <v-btn small icon v-if="$store.state.editMode" @click="removeGuide(subItem.id)"><v-icon>mdi-close</v-icon></v-btn>
...@@ -147,7 +147,7 @@ ...@@ -147,7 +147,7 @@
@click="openGuide(grandSubItem, item.title + '_' + subItem.title + '_' + grandSubItem.title)" @click="openGuide(grandSubItem, item.title + '_' + subItem.title + '_' + grandSubItem.title)"
active-class="active" active-class="active"
> >
<v-list-item-title v-text="$t('guide_title_' + item.title+ '_' + subItem.title+ '_' + grandSubItem.title)"></v-list-item-title> <v-list-item-title v-text="grandSubItem.title"></v-list-item-title>
<v-btn small icon v-if="$store.state.editMode" @click="removeGuide(grandSubItem.id)"><v-icon>mdi-close</v-icon></v-btn> <v-btn small icon v-if="$store.state.editMode" @click="removeGuide(grandSubItem.id)"><v-icon>mdi-close</v-icon></v-btn>
</v-list-item> </v-list-item>
</v-list-group> </v-list-group>
...@@ -161,7 +161,7 @@ ...@@ -161,7 +161,7 @@
:class="{active: isActiveMenu(subItem.id)}" :class="{active: isActiveMenu(subItem.id)}"
:style="isActiveMenu(subItem.id) ? 'border-left:2px solid #1E88E5;' : 'border-left:1px solid rgba(0,0,0,0.15);'" :style="isActiveMenu(subItem.id) ? 'border-left:2px solid #1E88E5;' : 'border-left:1px solid rgba(0,0,0,0.15);'"
> >
<v-list-item-title v-text="$t('guide_title_' + item.title+ '_' + subItem.title)"></v-list-item-title> <v-list-item-title v-text="subItem.title"></v-list-item-title>
<v-btn small icon v-if="$store.state.editMode" @click="removeGuide(subItem.id)"><v-icon>mdi-close</v-icon></v-btn> <v-btn small icon v-if="$store.state.editMode" @click="removeGuide(subItem.id)"><v-icon>mdi-close</v-icon></v-btn>
</v-list-item> </v-list-item>
...@@ -215,8 +215,7 @@ ...@@ -215,8 +215,7 @@
<span style="cursor:pointer;" class="pa-2"> <span style="cursor:pointer;" class="pa-2">
<img @click="$router.push('/docs')" class="mobile-hide" src="/logo_v2/01.png" cover height="28"/> <img @click="$router.push('/')" src="/logo_v2/01.png" cover height="28"/>
<img @click="$router.push('/docs')" class="mobile-show" src="/logo_v2/s01.png" cover height="36"/>
</span> </span>
<v-spacer/> <v-spacer/>
...@@ -344,7 +343,7 @@ export default{ ...@@ -344,7 +343,7 @@ export default{
isActiveMenu(id) { isActiveMenu(id) {
if(this.$route.path !== '/docs' && id === this.$store.state.guideId) { if(this.$route.path !== '/' && id === this.$store.state.guideId) {
return true return true
} }
return false return false
...@@ -352,7 +351,7 @@ export default{ ...@@ -352,7 +351,7 @@ export default{
// 가이드 페이지 이동 // 가이드 페이지 이동
openGuide(guide, path) { openGuide(guide, path) {
this.$router.push('/docs/' + path) this.$router.push('/' + path)
this.$store.commit('setGuide',{guideId:guide.id, flag:false}) this.$store.commit('setGuide',{guideId:guide.id, flag:false})
this.$store.state.guideId = guide.id this.$store.state.guideId = guide.id
}, },
...@@ -362,7 +361,7 @@ export default{ ...@@ -362,7 +361,7 @@ export default{
await this.$axios.get('http://docs.vridgeai.com/api/index') await this.$axios.get('http://docs.vridgeai.com/api/index')
.then(res => { .then(res => {
this.guideIndex = res.data.body this.guideIndex = res.data
}) })
.catch(err => { .catch(err => {
console.log(err) console.log(err)
...@@ -466,7 +465,7 @@ export default{ ...@@ -466,7 +465,7 @@ export default{
search(){ search(){
if(this.keyword){ if(this.keyword){
this.$router.push('/docs/search?keyword=' + this.keyword) this.$router.push('/search?keyword=' + this.keyword)
this.keyword = '' this.keyword = ''
} }
}, },
...@@ -486,13 +485,10 @@ export default{ ...@@ -486,13 +485,10 @@ export default{
return this.$store.state.guideNavigator return this.$store.state.guideNavigator
} }
},
created() {
this.getGuideIndex()
}, },
mounted(){ mounted(){
this.getGuideIndex()
window.addEventListener("scroll", this.scrollEvent); window.addEventListener("scroll", this.scrollEvent);
}, },
......
...@@ -41,7 +41,7 @@ export default { ...@@ -41,7 +41,7 @@ export default {
// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins // Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
plugins: [ plugins: [
'~/plugins/global.js' //'~/plugins/global.js'
], ],
// Auto import components: https://go.nuxtjs.dev/config-components // Auto import components: https://go.nuxtjs.dev/config-components
...@@ -55,7 +55,8 @@ export default { ...@@ -55,7 +55,8 @@ export default {
// Modules: https://go.nuxtjs.dev/config-modules // Modules: https://go.nuxtjs.dev/config-modules
modules: [ modules: [
'nuxt-healthcheck' 'nuxt-healthcheck',
'@nuxtjs/markdownit'
], ],
// Vuetify module configuration: https://go.nuxtjs.dev/config-vuetify // Vuetify module configuration: https://go.nuxtjs.dev/config-vuetify
...@@ -119,4 +120,14 @@ export default { ...@@ -119,4 +120,14 @@ export default {
return JSON.stringify({result: 'ok'}) return JSON.stringify({result: 'ok'})
} }
}, },
markdownit: {
preset: 'default',
linkify: true,
breaks: true,
use: [
'markdown-it-div',
'markdown-it-attrs'
]
}
} }
\ No newline at end of file
This diff is collapsed.
...@@ -10,7 +10,10 @@ ...@@ -10,7 +10,10 @@
}, },
"dependencies": { "dependencies": {
"@nuxtjs/axios": "^5.13.6", "@nuxtjs/axios": "^5.13.6",
"@nuxtjs/markdownit": "^2.0.0",
"core-js": "^3.25.3", "core-js": "^3.25.3",
"markdown-it-attrs": "^4.1.6",
"markdown-it-div": "^1.1.0",
"nuxt": "^2.15.8", "nuxt": "^2.15.8",
"nuxt-healthcheck": "^1.0.1", "nuxt-healthcheck": "^1.0.1",
"sass-loader": "^10.2.0", "sass-loader": "^10.2.0",
......
...@@ -17,24 +17,22 @@ ...@@ -17,24 +17,22 @@
<span v-if="!loading && guide !== null"> <span v-if="!loading && guide !== null">
<v-breadcrumbs <v-breadcrumbs
class="ma-0 px-0 py-2 " class="ma-0 px-0 py-2 "
:items="getBreadcrumbs(guide)" :items="getBreadcrumbs()"
> >
<template v-slot:divider> <template v-slot:divider>
<v-icon dark>mdi-chevron-right</v-icon> <v-icon dark>mdi-chevron-right</v-icon>
</template> </template>
<template v-slot:item= "{item}"> <template v-slot:item= "{item}">
<!-- <span class="text--grey text--caption" style="cursor:pointer;" @click="openGuide(item.content)" >{{item.text}}</span> --> <span class="text--grey text--caption" style="cursor:pointer;" @click="openGuide(item.path)" >{{item.text}}</span>
<span class="text--caption">{{item.text}}</span>
</template> </template>
</v-breadcrumbs> </v-breadcrumbs>
<h1 v-text="$t('guide_title_' + $route.params.guide)" class="font-weight-bold"></h1> <h1 v-text="guide.title" class="font-weight-bold"></h1>
</span> </span>
<v-spacer/> <v-spacer/>
<span v-if="!loading && guide !== null"> <span v-if="!loading && guide !== null">
<!-- <span class="">{{$time.dateToFormatKorean(guide.updateDate)}}</span> -->
<v-tooltip bottom transition="slide-y-transition"> <v-tooltip bottom transition="slide-y-transition">
<template v-slot:activator="{on, attrs}"> <template v-slot:activator="{on, attrs}">
<v-btn dark v-on="on" v-bind="attrs" icon @click="openGithub(guide.contentKey)"><v-icon>mdi-github</v-icon></v-btn> <v-btn dark v-on="on" v-bind="attrs" icon @click="openGithub(guide.contentKey)"><v-icon>mdi-github</v-icon></v-btn>
...@@ -55,7 +53,7 @@ ...@@ -55,7 +53,7 @@
style="width:100%;" style="width:100%;"
></v-skeleton-loader> ></v-skeleton-loader>
<div v-if="$store.state.editMode && guide"> <!-- <div v-if="$store.state.editMode && guide">
<v-chip v-if="guide.keywordSet !== null" small label v-for="item in guide.keywordSet" :key="item" class="mr-1" close @click:close="removeKeyword(item)"> <v-chip v-if="guide.keywordSet !== null" small label v-for="item in guide.keywordSet" :key="item" class="mr-1" close @click:close="removeKeyword(item)">
{{item}} {{item}}
</v-chip> </v-chip>
...@@ -77,7 +75,7 @@ ...@@ -77,7 +75,7 @@
</v-text-field> </v-text-field>
</template> </template>
</vridge-dialog> </vridge-dialog>
</div> </div> -->
<div v-if="!loading && guide && guide.content" v-html="$md.render(guide.content)" style="padding-bottom:200px;"></div> <div v-if="!loading && guide && guide.content" v-html="$md.render(guide.content)" style="padding-bottom:200px;"></div>
</v-row> </v-row>
...@@ -93,7 +91,7 @@ ...@@ -93,7 +91,7 @@
<v-col align="end" justify="end"> <v-col align="end" justify="end">
<span class="grey--text">이전 페이지</span> <br/> <span class="grey--text">이전 페이지</span> <br/>
<span style="font-size:1.1rem;font-weight:bold;"> <span style="font-size:1.1rem;font-weight:bold;">
{{$t('guide_title_' + parsingContentTitle(guide.prevContent))}} {{parsingContentTitle(guide.prevContent)}}
</span> </span>
</v-col> </v-col>
...@@ -114,7 +112,7 @@ ...@@ -114,7 +112,7 @@
<v-col align="start" justify="start"> <v-col align="start" justify="start">
<span class="grey--text">다음 페이지</span> <br/> <span class="grey--text">다음 페이지</span> <br/>
<span style="font-size:1.1rem;font-weight:bold;"> <span style="font-size:1.1rem;font-weight:bold;">
{{$t('guide_title_' + parsingContentTitle(guide.nextContent))}} {{ parsingContentTitle(guide.nextContent)}}
</span> </span>
</v-col> </v-col>
<v-col class="ml-8"> <v-col class="ml-8">
...@@ -129,26 +127,6 @@ ...@@ -129,26 +127,6 @@
></v-skeleton-loader> ></v-skeleton-loader>
</v-row> </v-row>
</v-container> </v-container>
<!-- <v-container v-if="$store.state.editMode" fluid>
<v-row no-gutters v-if="guide !== null" align="center">
<v-text-field filled :maxlength="50" hide-details solo label="title" v-model="guide.title" class="no-shadow font-weight-bold px-4">
</v-text-field>
<v-spacer/>
<span class="grey--text" style="font-size:1rem; " v-if="!loading && guide !== null">
updated: <span class="mx-2">{{$time.toLocalDateTimeString(guide.updateDate)}}</span>
</span>
<v-btn text @click="$store.state.editMode = false">취소</v-btn>
<v-btn class="mr-4" color="primary" @click="save">저장</v-btn>
</v-row>
<v-row no-gutters >
<v-card v-if="guide" elevation="0" style="width:100%; height:100%;">
<v-card-text>
<VueEditor v-if="guide.content" v-model="guide.content" class="editor-content" />
</v-card-text>
</v-card>
</v-row>
</v-container> -->
</div> </div>
</template> </template>
...@@ -170,7 +148,7 @@ export default { ...@@ -170,7 +148,7 @@ export default {
} }
}) })
.then(res=>{ .then(res=>{
this.guide = res.data.body this.guide = res.data
}) })
.catch(err=>{ .catch(err=>{
console.log(err) console.log(err)
...@@ -213,28 +191,21 @@ export default { ...@@ -213,28 +191,21 @@ export default {
return titleKey return titleKey
}, },
getBreadcrumbs(content){ getBreadcrumbs(){
let items = [] let items = []
let keyArray = content.contentKey.replace('.md','').split('/') let paths = this.$route.path.substring(1).split('_')
let titleKey = 'guide_title' let pathTemp = ''
if(keyArray[0] !== keyArray[1]) { for(let i = 0; i < paths.length; i++) {
for(let i = 0; i < keyArray.length; i++) { pathTemp += paths[i]
titleKey += '_' + keyArray[i] let item = {
items.push({ text: paths[i],
text: this.$t(titleKey), paths: pathTemp
href: titleKey,
content: content
})
} }
} else { pathTemp += '_'
titleKey += '_' + keyArray[0]
items.push({ items.push(item)
text: this.$t(titleKey),
href: titleKey,
content: content
})
} }
return items return items
}, },
...@@ -299,7 +270,7 @@ export default { ...@@ -299,7 +270,7 @@ export default {
}, },
openGuide(guide) { openGuide(guide) {
this.$router.push('/docs/' + this.parsingContentTitle(guide)) this.$router.push('/' + this.parsingContentTitle(guide))
this.$store.commit('setGuide', {guideId:guide.id, flag:true}) this.$store.commit('setGuide', {guideId:guide.id, flag:true})
this.$store.state.guideId = guide.id this.$store.state.guideId = guide.id
}, },
......
<template>
<guide-board-editor
:board="board"
>
</guide-board-editor>
</template>
<script>
export default {
layout:'guide',
meta:{
title:'가이드 편집',
},
components: {
},
data:()=>({
board:null
}),
mounted(){
this.getBoard()
},
methods:{
getBoard(){
this.board.title = this.$route.params.guideSub
this.board.content = this.$store.state.guidSubList.contents
},
}
};
</script>
\ No newline at end of file
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<v-treeview :items="guideIndex" item-text="title"> <v-treeview :items="guideIndex" item-text="title">
<template v-slot:label="{ item }"> <template v-slot:label="{ item }">
<a @click="openGuide(item)">{{$t('guide_title_' + parsingContentTitle(item))}}</a> <a @click="openGuide(item)">{{parsingContentTitle(item)}}</a>
</template> </template>
</v-treeview> </v-treeview>
</v-card> </v-card>
...@@ -40,7 +40,7 @@ export default { ...@@ -40,7 +40,7 @@ export default {
this.$store.commit('setGuide', {guideId:null, flag:false}) this.$store.commit('setGuide', {guideId:null, flag:false})
this.$axios.get('http://docs.vridgeai.com/api/index') this.$axios.get('http://docs.vridgeai.com/api/index')
.then(res => { .then(res => {
this.guideIndex = res.data.body this.guideIndex = res.data
}) })
.catch(err => { .catch(err => {
console.log(err) console.log(err)
...@@ -48,7 +48,7 @@ export default { ...@@ -48,7 +48,7 @@ export default {
}, },
openGuide(guide) { openGuide(guide) {
this.$router.push('/docs/' + this.parsingContentTitle(guide)) this.$router.push('/' + this.parsingContentTitle(guide))
this.$store.commit('setGuide', {guideId:guide.id, flag:true}) this.$store.commit('setGuide', {guideId:guide.id, flag:true})
this.$store.state.guideId = guide.id this.$store.state.guideId = guide.id
}, },
......
...@@ -43,8 +43,8 @@ ...@@ -43,8 +43,8 @@
:key="item.id" :key="item.id"
class="text-center" class="text-center"
> >
<td>{{ $t('guide_title_' + parsingContentTitle(item))}}</td> <td>{{ parsingContentTitle(item)}}</td>
<td><a @click="openGuide(item)">{{ $t('guide_title_' + parsingContentTitle(item)) }}</a></td> <td><a @click="openGuide(item)">{{parsingContentTitle(item)}}</a></td>
</tr> </tr>
</tbody> </tbody>
</template> </template>
...@@ -82,13 +82,13 @@ export default { ...@@ -82,13 +82,13 @@ export default {
} }
this.documents = [] this.documents = []
await this.$axios.get('/docs/search',{ await this.$axios.get('/search',{
params:{ params:{
keyword: this.keyword keyword: this.keyword
} }
}) })
.then(res => { .then(res => {
this.documents = res.data.body this.documents = res.data
}) })
.catch(err => { .catch(err => {
console.log(err) console.log(err)
...@@ -99,7 +99,7 @@ export default { ...@@ -99,7 +99,7 @@ export default {
}, },
openGuide(guide) { openGuide(guide) {
this.$router.push('/docs/' + this.parsingContentTitle(guide)) this.$router.push('/' + this.parsingContentTitle(guide))
this.$store.commit('setGuide', {guideId:guide.id, flag:true}) this.$store.commit('setGuide', {guideId:guide.id, flag:true})
this.$store.state.guideId = guide.id this.$store.state.guideId = guide.id
}, },
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment