Skip to content
EN

Runtime API Examples

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

{
  "logo": "/logo.png",
  "siteTitle": false,
  "nav": [
    {
      "text": "首页",
      "link": "/"
    },
    {
      "text": "使用指南",
      "link": "/guide/installing-screen-studio"
    },
    {
      "text": "经验分享",
      "link": "/tips/buying-guide"
    }
  ],
  "sidebar": [
    {
      "text": "快速入门",
      "collapsed": true,
      "items": [
        {
          "text": "安装 Screen Studio",
          "link": "/guide/installing-screen-studio"
        },
        {
          "text": "系统要求",
          "link": "/guide/system-requirements"
        },
        {
          "text": "设置与权限",
          "link": "/guide/setting-up-permissions"
        },
        {
          "text": "激活 Screen Studio",
          "link": "/guide/activating-screen-studio"
        }
      ]
    },
    {
      "text": "缩放",
      "collapsed": true,
      "items": [
        {
          "text": "即时缩放",
          "link": "/guide/instant-zoom"
        },
        {
          "text": "添加与编辑缩放",
          "link": "/guide/adding-editing-zooms"
        },
        {
          "text": "禁用自动缩放",
          "link": "/guide/disable-automatic-zooms-"
        },
        {
          "text": "自动缩放",
          "link": "/guide/auto-zoom"
        },
        {
          "text": "手动缩放",
          "link": "/guide/manual-zoom"
        }
      ]
    },
    {
      "text": "录制",
      "collapsed": true,
      "items": [
        {
          "text": "新建录制",
          "link": "/guide/new-recording"
        },
        {
          "text": "录制整个屏幕",
          "link": "/guide/recording-entire-display"
        },
        {
          "text": "录制单个窗口",
          "link": "/guide/recording-single-window"
        },
        {
          "text": "录制指定区域",
          "link": "/guide/recording-area"
        },
        {
          "text": "摄像头与麦克风",
          "link": "/guide/webcam-microphone"
        },
        {
          "text": "管理录制进度",
          "link": "/guide/managing-recording-in-progress"
        },
        {
          "text": "录制标记",
          "link": "/guide/recording-flag"
        },
        {
          "text": "新录制的项目设置",
          "link": "/guide/managing-project-settings-for-new-recordings"
        },
        {
          "text": "录制系统音频",
          "link": "/guide/recording-system-audio"
        },
        {
          "text": "隐藏 Dock 图标",
          "link": "/guide/hiding-dock-icon"
        },
        {
          "text": "iPhone 镜像",
          "link": "/guide/iphone-mirroring"
        },
        {
          "text": "录制 iPhone 与 iPad",
          "link": "/guide/recording-iphone-ipad"
        },
        {
          "text": "开始与结束录制",
          "link": "/guide/starting-finishing-the-recording"
        },
        {
          "text": "Screen Studio 快捷键",
          "link": "/guide/screen-studio-shortcuts"
        },
        {
          "text": "演讲者备注",
          "link": "/guide/speaker-notes-"
        },
        {
          "text": "从已有视频创建项目",
          "link": "/guide/creating-project-from-existing-video"
        }
      ]
    },
    {
      "text": "编辑项目",
      "collapsed": true,
      "items": [
        {
          "text": "画面比例",
          "link": "/guide/aspect-ratio"
        },
        {
          "text": "裁剪录制内容",
          "link": "/guide/cropping-the-recording"
        },
        {
          "text": "修剪",
          "link": "/guide/trimming"
        },
        {
          "text": "加速视频",
          "link": "/guide/speeding-up-the-video"
        },
        {
          "text": "设置音量",
          "link": "/guide/set-volume"
        },
        {
          "text": "进度条",
          "link": "/guide/scrubber"
        },
        {
          "text": "加速打字片段",
          "link": "/guide/speed-up-typing-segments"
        },
        {
          "text": "添加遮罩与高亮",
          "link": "/guide/adding-a-mask-and-highlight"
        },
        {
          "text": "命令菜单",
          "link": "/guide/command-menu"
        }
      ]
    },
    {
      "text": "外观",
      "collapsed": true,
      "items": [
        {
          "text": "背景",
          "link": "/guide/background"
        },
        {
          "text": "光标",
          "link": "/guide/cursor"
        },
        {
          "text": "禁用鼠标平滑移动",
          "link": "/guide/disable-smooth-mouse-movement"
        },
        {
          "text": "在特定片段隐藏光标",
          "link": "/guide/hiding-the-cursor-in-specific-sections"
        },
        {
          "text": "鼠标点击音效",
          "link": "/guide/mouse-click-sound"
        },
        {
          "text": "摄像头设置",
          "link": "/guide/camera-settings"
        },
        {
          "text": "摄像头",
          "link": "/guide/camera"
        },
        {
          "text": "动态摄像头布局",
          "link": "/guide/dynamic-camera-layouts-"
        },
        {
          "text": "字幕",
          "link": "/guide/captions"
        },
        {
          "text": "背景音乐",
          "link": "/guide/background-music"
        },
        {
          "text": "快捷键",
          "link": "/guide/shortcuts"
        },
        {
          "text": "动画",
          "link": "/guide/animations"
        },
        {
          "text": "复制当前帧为图片",
          "link": "/guide/copy-current-frame-as-an-image"
        }
      ]
    },
    {
      "text": "预设",
      "collapsed": true,
      "items": [
        {
          "text": "创建预设",
          "link": "/guide/creating-preset"
        },
        {
          "text": "应用预设",
          "link": "/guide/applying-preset"
        },
        {
          "text": "分享预设",
          "link": "/guide/sharing-preset"
        }
      ]
    },
    {
      "text": "导出",
      "collapsed": true,
      "items": [
        {
          "text": "导出视频",
          "link": "/guide/exporting-the-video"
        },
        {
          "text": "导出设置说明",
          "link": "/guide/explanation-of-export-settings"
        },
        {
          "text": "性能设置",
          "link": "/guide/performance-settings"
        },
        {
          "text": "可分享链接",
          "link": "/guide/shareable-links"
        },
        {
          "text": "可分享链接:评论",
          "link": "/guide/shareable-links-comments"
        },
        {
          "text": "提取原始录制文件",
          "link": "/guide/extracting-raw-recording-files"
        },
        {
          "text": "快速分享小部件",
          "link": "/guide/quick-share-widget-"
        }
      ]
    },
    {
      "text": "保存与分享",
      "collapsed": true,
      "items": [
        {
          "text": "保存项目",
          "link": "/guide/saving-your-project"
        },
        {
          "text": "分享项目",
          "link": "/guide/sharing-your-project"
        }
      ]
    },
    {
      "text": "故障排除",
      "collapsed": true,
      "items": [
        {
          "text": "诊断信息",
          "link": "/guide/diagnostic-info"
        },
        {
          "text": "账户激活访问问题",
          "link": "/guide/activating-account-access-issue"
        },
        {
          "text": "解决预设访问问题",
          "link": "/guide/resolving-presets-access-issue"
        },
        {
          "text": "捕获通知",
          "link": "/guide/capturing-notifications"
        },
        {
          "text": "管理许可证",
          "link": "/guide/managing-license"
        },
        {
          "text": "更新邮箱地址",
          "link": "/guide/update-your-email-address"
        }
      ]
    },
    {
      "text": "── 经验分享 ──",
      "collapsed": false,
      "items": [
        {
          "text": "购买与下载",
          "link": "/tips/buying-guide"
        },
        {
          "text": "使用技巧",
          "link": "/tips/usage-tips"
        },
        {
          "text": "个人评测",
          "link": "/tips/review"
        }
      ]
    }
  ],
  "search": {
    "provider": "local",
    "options": {
      "translations": {
        "button": {
          "buttonText": "搜索",
          "buttonAriaLabel": "搜索"
        },
        "modal": {
          "noResultsText": "没有找到相关结果",
          "resetButtonTitle": "清除搜索条件",
          "footer": {
            "selectText": "选择",
            "navigateText": "切换",
            "closeText": "关闭"
          }
        }
      }
    }
  },
  "footer": {
    "message": "本站为 Screen Studio 官方使用指南的中文翻译镜像,官方本身并没有中文官网及汉化支持,这点要注意,小心被骗。</br> 唯一官网请认准 <a href=\"https://screen.studio?aff=pZenep\" target=\"_blank\">Screen Studio</a> 。",
    "copyright": "Copyright © 2026-present"
  },
  "socialLinks": [
    {
      "icon": {
        "svg": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 15v-4H7l5-8v4h4l-5 8z\"/></svg>"
      },
      "link": "https://1991421.cn",
      "ariaLabel": "博客"
    }
  ]
}

Page Data

{
  "title": "Runtime API Examples",
  "description": "",
  "frontmatter": {
    "outline": "deep"
  },
  "headers": [],
  "relativePath": "api-examples.md",
  "filePath": "api-examples.md"
}

Page Frontmatter

{
  "outline": "deep"
}

More

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

本站为 Screen Studio 官方使用指南的中文翻译镜像,官方本身并没有中文官网及汉化支持,这点要注意,小心被骗。
唯一官网请认准 Screen Studio