File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -31,16 +31,16 @@ export default {
31
31
``` ts
32
32
import { defineConfig } from ' vitepress'
33
33
34
- export default async () => defineConfig ( {
35
- const posts = await (await fetch (' https://my-cms.com/blog-posts' )).json ()
34
+ export default async () => {
35
+ const posts = await (await fetch (' https://my-cms.com/blog-posts' )).json ()
36
36
37
- return {
37
+ return defineConfig ( {
38
38
// 应用级配置选项
39
39
lang: ' en-US' ,
40
40
title: ' VitePress' ,
41
41
description: ' Vite & Vue powered static site generator.' ,
42
42
43
- // 主题级别配置选项
43
+ // 主题级配置选项
44
44
themeConfig: {
45
45
sidebar: [
46
46
... posts .map ((post ) => ({
@@ -49,8 +49,8 @@ export default async () => defineConfig({
49
49
}))
50
50
]
51
51
}
52
- }
53
- })
52
+ })
53
+ }
54
54
```
55
55
56
56
也可以在最外层使用 ` await ` 。例如:
You can’t perform that action at this time.
0 commit comments