Appearance
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
{
"siteTitle": "",
"logo": "/bandbbs_logo.png",
"nav": [
{
"text": "产品百科",
"link": "/ProductWiki"
},
{
"text": "教程",
"link": "/Guides"
},
{
"text": "关于",
"link": "/About"
},
{
"text": "公告",
"link": "/Announcements/"
},
{
"text": "前往米坛社区",
"link": "https://bandbbs.cn",
"target": "_blank",
"rel": "noopener noreferrer"
}
],
"outline": {
"level": [
2,
3
]
},
"announcement": {
"enabled": true,
"title": "站点公告",
"content": "欢迎访问米坛知识库!如遇问题,可前往社区反馈。",
"listTitle": "近期公告",
"maxItems": 6,
"items": [
{
"title": "第三方应用文档申请开放",
"date": "2026-3-25",
"content": "Bandbbs Wiki第三方文档申请现已开放, 欢迎应用开发者提交申请. 详情请查看文档",
"link": "https://workspace.bandbbs.cn/share/axlyl4wim0/p/-Xptc9XEg2T",
"linkText": "查看文档"
},
{
"title": "知识库导航升级",
"date": "2026-03-10",
"content": "新版导航已上线,欢迎反馈使用体验。",
"link": "/About/",
"linkText": "查看说明"
},
{
"title": "图片放大功能优化",
"date": "2026-03-05",
"content": "点击图片可查看大图,移动端也支持。"
}
],
"confirmText": "我知道了",
"closeText": "稍后再看",
"showOnce": true,
"storageKey": "bandbbs-announcement-v1",
"overlayClose": true
},
"announcementPage": {
"description": "这里汇总站内最新公告与更新记录。"
},
"sidebar": {
"/ProductWiki/": [
{
"text": "产品百科",
"items": [
{
"text": "设备",
"items": [
{
"text": "Xiaomi",
"link": "/ProductWiki/devices/Xiaomi",
"items": [
{
"text": "手表",
"collapsed": true,
"items": [
{
"text": "Xiaomi Watch S5",
"link": "/ProductWiki/devices/Xiaomi/Watch/XiaomiWatchS5"
}
]
},
{
"text": "其他说明",
"collapsed": true,
"items": [
{
"text": "设备参数",
"link": "/ProductWiki/devices/Xiaomi/device"
},
{
"text": "设备命名",
"link": "/ProductWiki/devices/Xiaomi/name"
},
{
"text": "设备代号",
"link": "/ProductWiki/devices/Xiaomi/xiaomi-wearable-codes"
}
]
}
],
"collapsed": true
},
{
"text": "REDMI",
"items": []
},
{
"text": "HUAWEI",
"items": []
},
{
"text": "OPPO",
"items": []
}
]
},
{
"text": "硬件平台",
"items": [
{
"text": "Apollo"
},
{
"text": "Bestechnic"
},
{
"text": "Qualcomm"
},
{
"text": "Hisilicon"
},
{
"text": "XRING",
"items": [
{
"text": "XRING T1",
"link": "/ProductWiki/platforms/XRING/XRING-T1"
}
],
"collapsed": true
}
]
}
]
}
],
"/Guides/": [
{
"text": "教程",
"items": [
{
"text": "米坛社区",
"items": [
{
"text": "米坛社区app下载教程",
"link": "/Guides/bandbbs/bandbbs-app-download"
},
{
"text": "米坛社区注册教程",
"link": "/Guides/bandbbs/米坛社区注册教程"
}
],
"collapsed": true
},
{
"text": "表盘自定义工具",
"items": [
{
"text": "使用表盘自定义工具安装你的第一个表盘",
"link": "/Guides/watchface_custom_tool/使用表盘自定义工具安装你的第一个表盘"
},
{
"text": "快速了解表盘自定义工具使用",
"link": "/Guides/watchface_custom_tool/快速了解表盘自定义工具使用"
},
{
"text": "使用自定义工具安装快应用&表盘",
"link": "/Guides/watchface_custom_tool/使用自定义工具安装快应用&表盘"
},
{
"text": "使用自定义工具获取Authkey",
"link": "/Guides/watchface_custom_tool/使用自定义工具获取Authkey"
},
{
"text": "表盘自定义工具常见问题",
"link": "/Guides/watchface_custom_tool/表盘自定义工具常见问题"
}
],
"collapsed": true
},
{
"text": "AstroBox V1",
"items": [
{
"text": "使用AstroBox安装你的第一个表盘",
"link": "/Guides/astrobox/使用AstroBox安装你的第一个表盘"
},
{
"text": "AstroboxV1入门安装篇",
"link": "/Guides/astrobox/AstroboxV1入门安装篇"
},
{
"text": "AstroboxV1下载资源安装篇",
"link": "/Guides/astrobox/AstroboxV1下载资源安装篇"
},
{
"text": "AstroboxV1连接篇",
"link": "/Guides/astrobox/AstroboxV1连接篇"
},
{
"text": "AstroboxV1功能篇",
"link": "/Guides/astrobox/AstroboxV1功能篇"
},
{
"text": "AstroboxV1账号篇",
"link": "/Guides/astrobox/AstroboxV1账号篇"
},
{
"text": "AstroboxV1其他篇",
"link": "/Guides/astrobox/AstroboxV1其他篇"
}
],
"collapsed": true
},
{
"text": "BandBurg",
"items": [
{
"text": "BandBurg使用教程",
"link": "/Guides/BandBurg/BandBurg使用教程"
}
],
"collapsed": true
},
{
"text": "快应用相关",
"items": [
{
"text": "Omusic同步Cookie",
"link": "/Guides/astrobox-plugins/Omusic同步Cookie"
},
{
"text": "喵喵电子书",
"link": "/Guides/third-party-apps/喵喵电子书"
},
{
"text": "弦电子书常见问题",
"link": "/Guides/third-party-apps/luoxe-ebook-question"
},
{
"text": "微风天气激活教程",
"link": "/Guides/third-party-apps/breeze-weather-quetion"
}
],
"collapsed": true
}
]
}
],
"/Studio/": [
{
"text": "Studio",
"items": [
{
"text": "Wiki 编辑器",
"link": "/Studio/wiki-editor"
}
]
}
]
},
"socialLinks": [],
"search": {
"provider": "local"
},
"footer": {
"copyright": "Copyright ©2019-2026 米坛社区. all right reserved."
},
"lastUpdated": {
"text": "上次更新"
}
}Page Data
{
"title": "Runtime API Examples",
"description": "",
"frontmatter": {
"outline": "deep"
},
"headers": [],
"relativePath": "api-examples.md",
"filePath": "api-examples.md",
"lastUpdated": 1771819183000
}Page Frontmatter
{
"outline": "deep"
}More
Check out the documentation for the full list of runtime APIs.
