Skip to content

资源

This page demonstrates usage of some of the runtime APIs provided by VitePress.

The main useData() API can be used to access site, theme, and page data for the current page. It works in both .md and .vue files:

md
<script setup>
import { useData } from 'vitepress'

const { theme, page, frontmatter } = useData()
</script>

## Results

### Theme Data
<pre>{{ theme }}</pre>

### Page Data
<pre>{{ page }}</pre>

### Page Frontmatter
<pre>{{ frontmatter }}</pre>

Results

Theme Data

{
  "footer": {
    "copyright": "Copyright © 2026 CloseX"
  },
  "nav": [
    {
      "text": "更多",
      "items": [
        {
          "text": "隐私政策",
          "link": "/zh/privacy"
        },
        {
          "text": "发行说明",
          "link": "/zh/release-note"
        },
        {
          "text": "博客",
          "link": "https://blog.closex.org"
        },
        {
          "text": "CloseX",
          "link": "https://closex.org"
        },
        {
          "text": "联系我们",
          "link": "mailto:[email protected]"
        }
      ]
    }
  ],
  "search": {
    "provider": "local",
    "options": {
      "locales": {
        "zh": {
          "translations": {
            "button": {
              "buttonText": "搜索文档",
              "buttonAriaLabel": "搜索文档"
            },
            "modal": {
              "noResultsText": "无法找到相关结果",
              "resetButtonTitle": "清除查询条件",
              "footer": {
                "selectText": "选择",
                "navigateText": "切换",
                "closeText": "关闭"
              }
            }
          }
        },
        "ja": {
          "translations": {
            "button": {
              "buttonText": "文書の検索",
              "buttonAriaLabel": "文書の検索"
            },
            "modal": {
              "noResultsText": "関連する結果が見つかりませんでした",
              "resetButtonTitle": "クエリ条件をクリアする",
              "footer": {
                "selectText": "選ぶ",
                "navigateText": "スイッチ",
                "closeText": "閉鎖"
              }
            }
          }
        }
      }
    }
  },
  "logo": "/img/logo.webp",
  "sidebar": {
    "/zh/launchnext/": [
      {
        "text": "LaunchNext",
        "items": [
          {
            "text": "概览",
            "link": "/zh/launchnext/"
          },
          {
            "text": "快速开始",
            "link": "/zh/launchnext/getting-started"
          },
          {
            "text": "设置",
            "link": "/zh/launchnext/settings/"
          },
          {
            "text": "CLI 与 TUI",
            "link": "/zh/launchnext/cli-and-tui"
          },
          {
            "text": "更新与排障",
            "link": "/zh/launchnext/updates-and-troubleshooting"
          }
        ]
      },
      {
        "text": "设置标签页",
        "items": [
          {
            "text": "常规",
            "link": "/zh/launchnext/settings/general"
          },
          {
            "text": "外观",
            "link": "/zh/launchnext/settings/appearance"
          },
          {
            "text": "性能",
            "link": "/zh/launchnext/settings/performance"
          },
          {
            "text": "标题",
            "link": "/zh/launchnext/settings/titles"
          },
          {
            "text": "应用来源",
            "link": "/zh/launchnext/settings/app-sources"
          },
          {
            "text": "隐藏应用",
            "link": "/zh/launchnext/settings/hidden-apps"
          },
          {
            "text": "卸载",
            "link": "/zh/launchnext/settings/uninstall"
          },
          {
            "text": "快捷键与手势",
            "link": "/zh/launchnext/settings/shortcuts"
          },
          {
            "text": "备份",
            "link": "/zh/launchnext/settings/backup"
          },
          {
            "text": "开发",
            "link": "/zh/launchnext/settings/development"
          },
          {
            "text": "声音",
            "link": "/zh/launchnext/settings/sound"
          },
          {
            "text": "游戏控制器",
            "link": "/zh/launchnext/settings/game-controller"
          }
        ]
      }
    ],
    "/zh/": [
      {
        "text": "项目",
        "collapsed": true,
        "items": [
          {
            "text": "LaunchNext",
            "link": "/zh/launchnext/"
          },
          {
            "text": "TranslateNext",
            "link": "/zh/translatenext/"
          },
          {
            "text": "WhisperNext",
            "link": "/zh/whispernext/"
          },
          {
            "text": "SeeNext",
            "link": "/zh/seenext/"
          }
        ]
      },
      {
        "text": "LaunchNext 设置",
        "collapsed": true,
        "items": [
          {
            "text": "标题",
            "link": "/zh/launchnext/settings/titles"
          },
          {
            "text": "隐藏应用",
            "link": "/zh/launchnext/settings/hidden-apps"
          },
          {
            "text": "卸载",
            "link": "/zh/launchnext/settings/uninstall"
          },
          {
            "text": "快捷键与手势",
            "link": "/zh/launchnext/settings/shortcuts"
          },
          {
            "text": "声音",
            "link": "/zh/launchnext/settings/sound"
          },
          {
            "text": "游戏控制器",
            "link": "/zh/launchnext/settings/game-controller"
          }
        ]
      },
      {
        "text": "LaunchNext 进阶",
        "collapsed": true,
        "items": [
          {
            "text": "LaunchNext 概览",
            "link": "/zh/launchnext/"
          },
          {
            "text": "LaunchNext 设置",
            "link": "/zh/launchnext/settings-guide"
          },
          {
            "text": "LaunchNext 设置地图",
            "link": "/zh/launchnext/settings-overview"
          },
          {
            "text": "LaunchNext 备份与恢复",
            "link": "/zh/launchnext/backup-and-restore"
          },
          {
            "text": "LaunchNext 更新",
            "link": "/zh/launchnext/updates-and-troubleshooting"
          },
          {
            "text": "LaunchNext 开发",
            "link": "/zh/launchnext/settings/development"
          }
        ]
      }
    ]
  },
  "outline": {
    "label": "页面导航"
  },
  "docFooter": {
    "prev": "上一页",
    "next": "下一页"
  },
  "lastUpdated": {
    "text": "最后更新于",
    "formatOptions": {
      "dateStyle": "short",
      "timeStyle": "medium"
    }
  },
  "langMenuLabel": "多语言",
  "returnToTopLabel": "回到顶部",
  "sidebarMenuLabel": "菜单",
  "darkModeSwitchLabel": "主题",
  "lightModeSwitchTitle": "切换到浅色模式",
  "darkModeSwitchTitle": "切换到深色模式"
}

Page Data

{
  "title": "资源",
  "description": "",
  "frontmatter": {
    "outline": false,
    "sidebar": false,
    "aside": false
  },
  "headers": [],
  "relativePath": "zh/resources.md",
  "filePath": "zh/resources.md"
}

Page Frontmatter

{
  "outline": false,
  "sidebar": false,
  "aside": false
}

More

Check out the documentation for the full list of runtime APIs.