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>
<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": "/logo.png", "nav": [ { "text": "首页", "link": "https://www.supplyin.cn/index2.html" }, { "text": "解决方案", "items": [ { "text": "工程项目", "items": [ { "text": "项目档案", "link": "/10.solutions/10.工程项目/03.档案管理" }, { "text": "仓储管理", "link": "/10.solutions/10.工程项目/02.仓储管理" } ] }, { "text": "招投标", "items": [ { "text": "电子招投标", "link": "/10.solutions/20.招投标/01.电子招投标" }, { "text": "标书制作", "link": "/10.solutions/20.招投标/02.标书制作工具" }, { "text": "保证金管理", "link": "/10.solutions/20.招投标/03.保证金管理" } ] }, { "text": "供应链协同", "items": [ { "text": "供应链协同", "link": "/10.solutions/30.供应链协同/01.供应链协同" }, { "text": "快递登记", "link": "/10.solutions/30.供应链协同/04.快递登记" } ] } ] }, { "text": "开发平台", "items": [ { "text": "管理规范", "items": [ { "text": "产品设计规范", "link": "/30.openAPI/10.管理规范/01.产品设计" }, { "text": "Java开发规范", "link": "/30.openAPI/10.管理规范/02.Java开发" }, { "text": "Vue开发规范", "link": "/30.openAPI/10.管理规范/03.Vue开发" }, { "text": "问题管理规范", "link": "/30.openAPI/10.管理规范/04.问题管理规" }, { "text": "公文格式规范", "link": "/30.openAPI/10.管理规范/05.公文格式" } ] }, { "text": "SOP", "items": [ { "text": "git", "link": "/30.openAPI/20.SOP/01.git" }, { "text": "markdown", "link": "/30.openAPI/20.SOP/02.markdown" } ] }, { "text": "开放平台", "items": [ { "text": "免费API", "link": "/30.openAPI/30.开放平台/01.免费API接口" } ] } ] }, { "text": "服务支持", "items": [ { "text": "在线支持", "items": [ { "text": "仓储管理", "link": "/50.supports/10.仓储管理系统/01.操作手册" } ] } ] }, { "text": "关于", "items": [ { "text": "关于成就", "link": "/90.about/01.关于成就" }, { "text": "联系我们", "link": "/90.about/02.意见建议" } ] } ], "sidebar": { "/10.solutions/": [ { "text": "解决方案", "collapsible": true, "collapsed": true, "items": [ { "text": "10.工程项目", "collapsible": true, "collapsed": true, "items": [ { "text": "02.仓储管理", "link": "/10.solutions/10.工程项目/02.仓储管理" }, { "text": "03.档案管理", "link": "/10.solutions/10.工程项目/03.档案管理" } ] }, { "text": "20.招投标", "collapsible": true, "collapsed": true, "items": [ { "text": "01.电子招投标", "link": "/10.solutions/20.招投标/01.电子招投标" }, { "text": "02.标书制作工具", "link": "/10.solutions/20.招投标/02.标书制作工具" }, { "text": "03.保证金管理", "link": "/10.solutions/20.招投标/03.保证金管理" } ] }, { "text": "30.供应链协同", "collapsible": true, "collapsed": true, "items": [ { "text": "01.供应链协同", "link": "/10.solutions/30.供应链协同/01.供应链协同" }, { "text": "04.快递登记", "link": "/10.solutions/30.供应链协同/04.快递登记" } ] }, { "text": "40.软件工具", "collapsible": true, "collapsed": true, "items": [ { "text": "01.在线工具", "link": "/10.solutions/40.软件工具/01.在线工具" }, { "text": "02.网站资源", "link": "/10.solutions/40.软件工具/02.网站资源" } ] } ] } ], "/20.products/": [ { "text": "产品中心", "collapsible": true, "collapsed": true, "items": [ { "text": "01.仓储管理系统", "link": "/20.products/01.仓储管理系统" }, { "text": "03.档案管理系统", "link": "/20.products/03.档案管理系统" } ] } ], "/30.openAPI/": [ { "text": "开放API", "collapsible": true, "collapsed": true, "items": [ { "text": "10.管理规范", "collapsible": true, "collapsed": true, "items": [ { "text": "01.产品设计", "link": "/30.openAPI/10.管理规范/01.产品设计" }, { "text": "02.Java开发", "link": "/30.openAPI/10.管理规范/02.Java开发" }, { "text": "04.问题管理", "link": "/30.openAPI/10.管理规范/04.问题管理" }, { "text": "05.公文格式", "link": "/30.openAPI/10.管理规范/05.公文格式" } ] }, { "text": "20.SOP", "collapsible": true, "collapsed": true, "items": [ { "text": "01.git", "link": "/30.openAPI/20.SOP/01.git" }, { "text": "02.markdown", "link": "/30.openAPI/20.SOP/02.markdown" } ] }, { "text": "30.开放平台", "collapsible": true, "collapsed": true, "items": [ { "text": "01.免费API接口", "link": "/30.openAPI/30.开放平台/01.免费API接口" } ] } ] } ], "/40.articles/": [ { "text": "行业资讯", "collapsible": true, "collapsed": true, "items": [ { "text": "other", "collapsible": true, "collapsed": true, "items": [] } ] } ], "/50.supports/10.仓储管理系统": [ { "text": "仓储管理", "collapsible": true, "collapsed": true, "items": [ { "text": "01.操作手册", "link": "/50.supports/10.仓储管理系统/01.操作手册" }, { "text": "02.常见问题", "link": "/50.supports/10.仓储管理系统/02.常见问题" } ] } ], "/90.about/": [ { "text": "关于成就", "collapsible": true, "collapsed": true, "items": [ { "text": "01.关于成就", "link": "/90.about/01.关于成就" }, { "text": "02.意见建议", "link": "/90.about/02.意见建议" } ] } ] }, "lastUpdated": true, "lastUpdatedText": "上次更新时间", "smoothScroll": true, "footer": { "copyright": "版权所有 © 2015-2023 河南成就信息技术有限公司 | 技术支持: 0371-61281239 | 豫ICP备2021006572号" }, "search": { "provider": "local", "options": { "locales": { "zh": { "translations": { "button": { "buttonText": "搜索文档", "buttonAriaLabel": "搜索文档" }, "modal": { "noResultsText": "无法找到相关结果", "resetButtonTitle": "清除查询条件", "footer": { "selectText": "选择", "navigateText": "切换" } } } } } } }, "docFooter": { "prev": "上一篇", "next": "下一篇" }, "aside": true, "outline": "deep", "outlineBadges": true, "outlineTitle": "章节导航" }
Page Data
{ "title": "Runtime API Examples", "description": "", "frontmatter": { "outline": "deep" }, "headers": [], "relativePath": "api-examples.md", "filePath": "api-examples.md", "lastUpdated": 1697351905000 }
Page Frontmatter
{ "outline": "deep" }
More
Check out the documentation for the full list of runtime APIs.