Skip to content
On this page

문서화

문서화 도구

VitePress

위치

${PROJECT_HOME}/app/docs

vitepress config

${PROJECT_HOME}/app/docs/.vitepress/config.ts

.vitepress 폴더의 config.js 에서 상단메뉴를 nav에, 좌측메뉴를 sidebar에 설정한다.

import { defineConfig } from 'vitepress'

export default defineConfig({
  lang: 'ko-KR',
  title: 'smartERPLite \nVue Document',
  description: '',
  lastUpdated: true,

  
  head: [['link', { rel: 'icon', type: 'image/svg+xml', href: '/logo.svg' }]],
  
  themeConfig: {
    logo: '/logo.svg',
    lastUpdatedText: 'Updated Date',

    nav: nav(),

    sidebar: {
      '/guide/': sidebarGuide(),
      '/api/': sidebarApi()
    },

    footer: {
      message: 'Hello',
      copyright: 'Copyright © 2022 SmartBiz'
    },

  }
})

function nav() {
  return [
    { text: 'Guide', link: '/guide/get-started', activeMatch: '/guide/' },
    { text: 'Api', link: '/api/', activeMatch: '/api/' },
    // { text: '2022-06-27', link: '/version' },
    // { text: 'Vitepress Test', link: '/test/' },
  ]
}
function sidebarGuide() {
  return [
    {
      text: 'Guide',
      collapsible: true,
      items: [
        { text: '시작하기', link: '/guide/get-started' },
      ]
    },
    {
      text: 'Java',
      collapsible: true,
      items: [
        { text: '폴더구조', link: '/guide/java/structure' },
        { text: '서버환경 설정', link: '/guide/java/config' },
        { text: 'JavaBean', link: '/guide/java/model/java-bean' },
        { text: 'CamelMap', link: '/guide/java/model/camel-map' },
        { text: 'Lombok', link: '/guide/java/model/use-lombok' },
        { text: 'Controller', link: '/guide/java/mvc/controller' },
        { text: 'Service', link: '/guide/java/mvc/service' },
        { text: 'Mapper', link: '/guide/java/mvc/mapper' },
      ]
    },
    {
      text: 'Vue',
      collapsible: true,
      items: [
        { text: '폴더구조', link: '/guide/vue/structure' },
        { text: '파일작성', link: '/guide/vue/file' },
        { text: 'setup', link: '/guide/vue/setup' },
      ]
    },
    {
      text: '예제',
      collapsible: true,
      items: [
        { text: '조회', link: '/guide/example/query' },
        { text: '저장', link: '/guide/example/save' },
        { text: '필수입력', link: '/guide/example/require-check' },
        { text: '서브컴포넌트', link: '/guide/example/sub-component' },
        { text: '팝업(모달)', link: '/guide/example/popup' },
        { text: '업로드', link: '/guide/example/upload' },
      ]
    },
    {
      text: '문서화',
      collapsible: true,
      items: [
        { text: '설치', link: '/guide/vitepress-install' },
        { text: '설정', link: '/guide/vitepress-config' }
      ]
    },
  ]
}
function sidebarApi() {
  return [
    {
      text: 'Component',
      collapsible: true,
      items: [
        { text: '배치', link: '/api/component/layout' },
        { text: '버튼', link: '/api/component/button' },
        { text: '입력', link: '/api/component/form' },
        { text: '그리드', link: '/api/component/grid' },
        { text: '모달(팝업)', link: '/api/component/modal' },
        { text: '', link: '/api/component/tab' },
        { text: '트리', link: '/api/component/tree' },
      ]
    },
    {
      text: 'Hook',
      collapsible: true,
      items: [
        { text: 'useAuth', link: '/api/hook/use-auth' },
        { text: 'useCodeName', link: '/api/hook/use-auth' },
        { text: 'useMenu', link: '/api/hook/use-auth' },
        { text: 'useTab', link: '/api/hook/use-tab' },
      ]
    },
    {
      text: 'Function',
      collapsible: true,
      items: [
        { text: 'http', link: '/api/function/http' },
        { text: 'dateUtil', link: '/api/function/date-util' },
        { text: 'alert & confirm', link: '/api/function/alert&confirm' },
        { text: 'etc', link: '/api/function/etc' },
        { text: 'tree', link: '/api/function/tree' },
      ]
    },
    {
      text: 'Types',
      items: [
        { text: 'Types', link: '/api/types/types' }
      ]
    }
  ]
}

Hello