strapi5 的安装与使用
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
{ "search": { "provider": "local", "options": { "locales": { "zh": { "translations": { "button": { "buttonText": "搜索文档", "buttonAriaLabel": "搜索文档" }, "modal": { "noResultsText": "无法找到相关结果", "resetButtonTitle": "清除查询条件", "footer": { "selectText": "选择", "navigateText": "切换" } } } } } } }, "outlineTitle": "目录", "outline": [ 2, 6 ], "nav": [ { "text": "首页", "link": "/" }, { "text": "Daily_snap", "items": [ { "text": "介绍", "link": "docs/Daily_snap/介绍" } ] } ], "sidebar": { "/docs/": [ { "text": "Daily Snap", "collapsed": true, "items": [ { "text": "介绍", "link": "/docs/Daily_snap/介绍" } ] }, { "text": "GSAP", "collapsed": true, "items": [ { "text": "视差滚动", "link": "/docs/GSAP/视差滚动" } ] }, { "text": "Strapi", "collapsed": true, "items": [ { "text": "安装", "link": "/docs/Strapi/安装" } ] }, { "text": "前端", "collapsed": true, "items": [ { "text": "CSS", "collapsed": true, "items": [ { "text": "Sass技巧", "link": "/docs/前端/CSS/Sass技巧" } ] }, { "text": "Flutter", "collapsed": true, "items": [ { "text": "Android Studio安装与使用", "link": "/docs/前端/Flutter/Android Studio安装与使用" }, { "text": "环境配置", "link": "/docs/前端/Flutter/环境配置" }, { "text": "语法基础", "link": "/docs/前端/Flutter/语法基础" } ] }, { "text": "Nuxt2", "collapsed": true, "items": [ { "text": "初始化", "link": "/docs/前端/Nuxt2/初始化" } ] }, { "text": "UniApp", "collapsed": true, "items": [ { "text": "初始化", "link": "/docs/前端/UniApp/初始化" } ] }, { "text": "Vue2", "collapsed": true, "items": [ { "text": "基础", "link": "/docs/前端/Vue2/基础" } ] }, { "text": "Vue3", "collapsed": true, "items": [ { "text": "基础", "link": "/docs/前端/Vue3/基础" } ] } ] } ], "/home/": [ { "text": "Vitepress", "collapsed": true, "items": [ { "text": "基础", "link": "/home/vitepress/基础" } ] }, { "text": "工作积累", "link": "/home/工作积累" }, { "text": "提效工具", "link": "/home/提效工具" }, { "text": "踩坑记录", "link": "/home/踩坑记录" } ] }, "socialLinks": [ { "icon": "github", "link": "https://github.com/vuejs/vitepress" } ], "footer": { "copyright": "Copyright © 2025 溜溜车&晃晃伞" } }
Page Data
{ "title": "strapi5 的安装与使用", "description": "", "frontmatter": { "outline": "deep" }, "headers": [], "relativePath": "docs/Strapi/安装.md", "filePath": "docs/Strapi/安装.md" }
Page Frontmatter
{ "outline": "deep" }
More
Check out the documentation for the full list of runtime APIs.