搜索 K
Appearance
Appearance
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:
<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>{
"editLink": false,
"nav": [
{
"text": "首页",
"link": "/"
},
{
"text": "知产工作台使用手册",
"link": "/manual/"
},
{
"text": "审查指南",
"link": "/guide/1"
},
{
"text": "实施细则",
"link": "/xize/1"
}
],
"sidebar": [
{
"text": "",
"items": [
{
"text": "知产工作台使用手册",
"link": "/markdown-examples",
"items": [
{
"text": "邮件往来",
"link": "/使用手册/邮件往来"
},
{
"text": "Runtime API Examples",
"link": "/api-examples"
}
]
}
]
},
{
"text": "",
"items": [
{
"text": "专利审查指南",
"link": "/审查指南",
"items": [
{
"text": "邮件往来",
"link": "/审查指南/"
},
{
"text": "Runtime API Examples",
"link": "/api-examples"
}
]
}
]
},
{
"text": "",
"items": [
{
"text": "专利审查实施细则",
"link": "/xize/1",
"collapsed": false,
"items": [
{
"text": "第一章 总则",
"link": "/xize/1"
},
{
"text": "第二章 专利的申请",
"link": "/xize/2"
},
{
"text": "第三章 专利申请的审查和批准",
"link": "/xize/3"
},
{
"text": "第四章 专利申请的复审与专利权的无效宣告",
"link": "/xize/4"
},
{
"text": "第五章 专利权期限补偿",
"link": "/xize/5"
},
{
"text": "第六章 专利实施的特别许可",
"link": "/xize/6"
},
{
"text": "第七章 对职务发明创造的发明人或者设计人的奖励和报酬",
"link": "/xize/7"
},
{
"text": "第八章 专利权的保护",
"link": "/xize/8"
},
{
"text": "第九章 专利登记和专利公报",
"link": "/xize/9"
},
{
"text": "第十章 费用",
"link": "/xize/10"
},
{
"text": "第十一章 关于发明、实用新型国际申请的特别规定",
"link": "/xize/11"
},
{
"text": "第十二章 关于外观设计国际申请的特别规定",
"link": "/xize/12"
},
{
"text": "第十三章 附则",
"link": "/xize/13"
}
]
}
]
},
{
"text": "其他",
"items": [
{
"text": "markdown examples",
"link": "/markdown-examples"
},
{
"text": "Runtime API Examples",
"link": "/api-examples"
}
]
}
],
"outline": {
"level": [
2,
3
],
"label": "导航"
},
"plugins": [
{
"name": "vitepress-plugin-pagefind"
}
]
}{
"title": "Runtime API Examples",
"description": "",
"frontmatter": {
"outline": "deep"
},
"headers": [],
"relativePath": "api-examples.md",
"filePath": "api-examples.md"
}{
"outline": "deep"
}Check out the documentation for the full list of runtime APIs.