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
{
"logo": {
"src": "/images/logo.png",
"alt": "RaySuz Logo"
},
"nav": [
{
"text": "Why RaySuz",
"link": "/"
},
{
"text": "实践指南",
"link": "/guide/"
},
{
"text": "开发参考手册",
"link": "/references/"
},
{
"text": "博客",
"link": "/blog/"
},
{
"text": "Odoo服务",
"link": "/odoo/"
},
{
"text": "Examples",
"link": "/examples/markdown-examples"
}
],
"outline": {
"label": "本页概述",
"level": [
2,
5
]
},
"search": {
"provider": "local",
"options": {
"locales": {
"root": {
"translations": {
"button": {
"buttonText": "搜索",
"buttonAriaLabel": "搜索"
},
"modal": {
"displayDetails": "显示详细列表",
"noResultsText": "没有结果",
"footer": {
"selectText": "选择",
"selectKeyAriaLabel": "输入",
"navigateText": "导航",
"navigateUpKeyAriaLabel": "上箭头",
"navigateDownKeyAriaLabel": "下箭头",
"closeText": "关闭",
"closeKeyAriaLabel": "Esc"
}
}
}
}
}
}
},
"docFooter": {
"prev": "上一页",
"next": "下一页"
},
"footer": {
"copyright": "版权所有 © 2019-至今 <a href=\"https://www.rayiot.cn\" target=\"_blank\">海南瑞霖物联网科技有限公司</a>"
},
"sidebar": {
"/guide/": {
"base": "/guide/",
"items": [
{
"text": "数据库管理",
"link": "database"
},
{
"text": "会计/财务",
"link": "finance/index.md",
"items": [
{
"text": "什么是“未结付款”?",
"link": "finance/account-outgoing-payment"
},
{
"text": "如何准确挂载应收/应付账款?",
"link": "finance/account-payable"
},
{
"text": "从采购单创建账单",
"link": "finance/account-purchase"
},
{
"text": "现金流量表",
"link": "finance/cash-flow"
},
{
"text": "费用模块的使用",
"link": "finance/expense"
},
{
"text": "计提工资和实发工资的问题",
"link": "finance/salary"
},
{
"text": "税务的一些知识点",
"link": "finance/tax"
},
{
"text": "为什么RaySuz的会计分录不允许借贷方为负值?",
"link": "finance/why-odoo-accounting-entry-not-allow-negative-debit-and-credit-values"
},
{
"text": "财务日记账",
"link": "finance/journal"
},
{
"text": "会计期初",
"link": "finance/openning-balance"
},
{
"text": "导入凭证/分录行",
"link": "finance/import-move-line"
},
{
"text": "资产模型",
"link": "finance/asset-model"
},
{
"text": "会计分录实操",
"link": "finance/accounting-practice"
}
],
"collapsed": false
},
{
"text": "供应链相关的业务",
"link": "scm/index.md",
"items": [
{
"text": "采购质检",
"link": "scm/采购质检"
},
{
"text": "MRP生产制造物料BOM库存不足的显示查看",
"link": "scm/制造物料BOM库存不足的显示查看"
},
{
"text": "从采购到质检到入到相应的库位",
"link": "scm/采购到质检到入到相应库位"
},
{
"text": "安全库存策略",
"link": "scm/安全库存策略"
},
{
"text": "按订单补货MTO",
"link": "scm/按订单补货MTO"
},
{
"text": "仓库之间补货",
"link": "scm/仓库之间补货"
},
{
"text": "芒果原浆案例",
"link": "scm/芒果原浆案例"
}
],
"collapsed": false
},
{
"text": "CRM学习记录案例分享",
"link": "CRM/index.md",
"items": [
{
"text": "CRM线索与商机",
"link": "CRM/CRM线索与商机"
}
],
"collapsed": false
},
{
"text": "蓝带案例分享",
"link": "MES/index.md",
"items": [
{
"text": "分享蓝带啤酒案例生产制造流程",
"link": "MES/结合蓝带啤酒分享生产制造流程"
},
{
"text": "制造订单安排日期的推算",
"link": "MES/生产排程"
},
{
"text": "制造订单开始安排日期与结束日期",
"link": "MES/制造订单开始安排日期与结束日期"
},
{
"text": "工作中心以及作业相关的属性值",
"link": "MES/工作中心以及作业相关的相关属性"
},
{
"text": "微信支付操作流程",
"link": "MES/微信支付操作过程"
}
],
"collapsed": false
},
{
"text": "Odoo 权限管理实战指南",
"link": "access-right"
}
]
},
"/references/": {
"base": "/references/",
"items": [
{
"text": "怎么定制财务报表?",
"link": "how-to-custom-account-reports"
},
{
"text": "Odoo 权限开发实战",
"link": "access-right"
}
]
},
"/examples/": {
"base": "/examples/",
"items": [
{
"text": "Api-examples",
"link": "api-examples"
},
{
"text": "Markdown-examples",
"link": "markdown-examples"
}
]
}
}
}Page Data
{
"title": "Runtime API Examples",
"description": "",
"frontmatter": {
"outline": "deep"
},
"headers": [],
"relativePath": "examples/api-examples.md",
"filePath": "examples/api-examples.md"
}Page Frontmatter
{
"outline": "deep"
}More
Check out the documentation for the full list of runtime APIs.
