1
1
import type { DefaultTheme , LocaleSpecificConfig } from 'vitepress'
2
2
3
- export const META_URL = 'https://pinia.vuejs.org'
4
- export const META_TITLE = 'Pinia 🍍'
5
- export const META_DESCRIPTION = '值得你喜欢的 Vue Store'
6
- // TODO: translation of this
7
- // 'Intuitive, type safe, light and flexible Store for Vue'
3
+ export const META_URL = 'https://router.vuejs.org'
4
+ export const META_TITLE = 'Vue Router'
5
+ export const META_DESCRIPTION = 'Vue.js 的官方路由'
8
6
9
7
export const zhConfig : LocaleSpecificConfig < DefaultTheme . Config > = {
10
8
description : META_DESCRIPTION ,
@@ -18,127 +16,160 @@ export const zhConfig: LocaleSpecificConfig<DefaultTheme.Config> = {
18
16
19
17
themeConfig : {
20
18
editLink : {
21
- pattern : 'https://github.com/vuejs/pinia /edit/v2/packages/docs/:path' ,
19
+ pattern : 'https://github.com/vuejs/router /edit/v2/packages/docs/:path' ,
22
20
text : '对本页提出修改建议' ,
23
21
} ,
24
22
25
23
outlineTitle : '本页内容' ,
26
24
27
25
nav : [
28
- // { text: 'Config', link: '/config/' },
29
- // { text: 'Plugins', link: '/plugins/' },
30
26
{
31
- text : '指南' ,
32
- link : '/zh/core-concepts/' ,
33
- activeMatch : '^/zh/core-concepts/' ,
27
+ text : '教程' ,
28
+ link : '/zh/guide/' ,
29
+ activeMatch : '^/zh/guide/' ,
30
+ } ,
31
+ {
32
+ text : 'API 参考' ,
33
+ link : '/zh/api/' ,
34
+ activeMatch : '^/zh/api/' ,
35
+ } ,
36
+ {
37
+ text : 'v4.x' ,
38
+ items : [ { text : 'v3.x' , link : 'https://v3.router.vuejs.org/zh' } ] ,
34
39
} ,
35
- { text : 'API' , link : '/zh/api/' , activeMatch : '^/zh/api/' } ,
36
- { text : '手册' , link : '/zh/cookbook/' , activeMatch : '^/zh/cookbook/' } ,
37
40
{
38
41
text : '相关链接' ,
39
42
items : [
40
43
{
41
- text : '论坛 ' ,
42
- link : 'https://github.com/vuejs/pinia /discussions' ,
44
+ text : 'Discussions ' ,
45
+ link : 'https://github.com/vuejs/router /discussions' ,
43
46
} ,
44
47
{
45
48
text : '更新日志' ,
46
- link : 'https://github.com/vuejs/pinia /blob/v2 /packages/pinia /CHANGELOG.md' ,
49
+ link : 'https://github.com/vuejs/router /blob/main /packages/router /CHANGELOG.md' ,
47
50
} ,
48
51
] ,
49
52
} ,
50
53
] ,
54
+
51
55
sidebar : {
52
56
'/zh/api/' : [
53
57
{
54
58
text : 'packages' ,
55
- items : [
56
- { text : 'pinia' , link : '/zh/api/modules/pinia.html' } ,
57
- { text : '@pinia/nuxt' , link : '/zh/api/modules/pinia_nuxt.html' } ,
58
- {
59
- text : '@pinia/testing' ,
60
- link : '/zh/api/modules/pinia_testing.html' ,
61
- } ,
62
- ] ,
59
+ items : [ { text : 'vue-router' , link : '/api/' } ] ,
63
60
} ,
64
61
] ,
62
+
65
63
'/zh/' : [
66
64
{
67
- text : '介绍' ,
68
65
items : [
69
66
{
70
- text : 'Pinia 是什么? ' ,
67
+ text : '介绍 ' ,
71
68
link : '/zh/introduction.html' ,
72
69
} ,
73
70
{
74
- text : '开始 ' ,
75
- link : '/zh/getting-started .html' ,
71
+ text : '安装 ' ,
72
+ link : '/zh/installation .html' ,
76
73
} ,
77
74
] ,
78
75
} ,
79
76
{
80
- text : '核心概念' ,
77
+ text : '基础' ,
78
+ collapsible : false ,
81
79
items : [
82
- { text : '定义 Store' , link : '/zh/core-concepts/' } ,
83
- { text : 'State' , link : '/zh/core-concepts/state.html' } ,
84
- { text : 'Getter' , link : '/zh/core-concepts/getters.html' } ,
85
- { text : 'Action' , link : '/zh/core-concepts/actions.html' } ,
86
- { text : '插件' , link : '/zh/core-concepts/plugins.html' } ,
87
80
{
88
- text : '组件外的 Store' ,
89
- link : '/zh/core-concepts/outside-component-usage.html' ,
81
+ text : '入门' ,
82
+ link : '/zh/guide/' ,
83
+ } ,
84
+ {
85
+ text : '动态路由匹配' ,
86
+ link : '/zh/guide/essentials/dynamic-matching.html' ,
87
+ } ,
88
+ {
89
+ text : '路由的匹配语法' ,
90
+ link : '/zh/guide/essentials/route-matching-syntax.html' ,
91
+ } ,
92
+ {
93
+ text : '嵌套路由' ,
94
+ link : '/zh/guide/essentials/nested-routes.html' ,
95
+ } ,
96
+ {
97
+ text : '编程式导航' ,
98
+ link : '/zh/guide/essentials/navigation.html' ,
99
+ } ,
100
+ {
101
+ text : '命名路由' ,
102
+ link : '/zh/guide/essentials/named-routes.html' ,
90
103
} ,
91
- ] ,
92
- } ,
93
- {
94
- text : '服务端渲染 (SSR)' ,
95
- items : [
96
104
{
97
- text : 'Vue 与 Vite ' ,
98
- link : '/zh/ssr/ ' ,
105
+ text : '命名视图 ' ,
106
+ link : '/zh/guide/essentials/named-views.html ' ,
99
107
} ,
100
108
{
101
- text : 'Nuxt.js' ,
102
- link : '/zh/ssr/nuxt.html' ,
109
+ text : '重定向和别名' ,
110
+ link : '/zh/guide/essentials/redirect-and-alias.html' ,
111
+ } ,
112
+ {
113
+ text : '路由组件传参' ,
114
+ link : '/zh/guide/essentials/passing-props.html' ,
115
+ } ,
116
+ {
117
+ text : '不同的历史记录模式' ,
118
+ link : '/zh/guide/essentials/history-mode.html' ,
103
119
} ,
104
120
] ,
105
121
} ,
106
122
{
107
- text : '手册' ,
108
- collapsible : true ,
109
- collapsed : false ,
123
+ text : '进阶' ,
124
+ collapsible : false ,
110
125
items : [
111
126
{
112
- text : '目录 ' ,
113
- link : '/zh/cookbook/ ' ,
127
+ text : '导航守卫 ' ,
128
+ link : '/zh/guide/advanced/navigation-guards.html ' ,
114
129
} ,
115
130
{
116
- text : '从 Vuex ≤4 迁移 ' ,
117
- link : '/zh/cookbook/migration-vuex .html' ,
131
+ text : '路由元信息 ' ,
132
+ link : '/zh/guide/advanced/meta .html' ,
118
133
} ,
119
134
{
120
- text : '热更新 ' ,
121
- link : '/zh/cookbook/hot-module-replacement .html' ,
135
+ text : '数据获取 ' ,
136
+ link : '/zh/guide/advanced/data-fetching .html' ,
122
137
} ,
123
138
{
124
- text : '测试 ' ,
125
- link : '/zh/cookbook/testing .html' ,
139
+ text : '组合式 API ' ,
140
+ link : '/zh/guide/advanced/composition-api .html' ,
126
141
} ,
127
142
{
128
- text : '不使用 setup() 的用法 ' ,
129
- link : '/zh/cookbook/options-api .html' ,
143
+ text : '过渡动效 ' ,
144
+ link : '/zh/guide/advanced/transitions .html' ,
130
145
} ,
131
146
{
132
- text : '组合式 Stores ' ,
133
- link : '/zh/cookbook/composing-stores .html' ,
147
+ text : '滚动行为 ' ,
148
+ link : '/zh/guide/advanced/scroll-behavior .html' ,
134
149
} ,
135
150
{
136
- text : '从 v0/v1 迁移至 v2 ' ,
137
- link : '/zh/cookbook/migration-v1-v2 .html' ,
151
+ text : '路由懒加载 ' ,
152
+ link : '/zh/guide/advanced/lazy-loading .html' ,
138
153
} ,
139
154
{
140
- text : '处理组合式函数' ,
141
- link : '/zh/cookbook/composables.html' ,
155
+ text : '扩展 RouterLink' ,
156
+ link : '/zh/guide/advanced/extending-router-link.html' ,
157
+ } ,
158
+ {
159
+ text : '导航故障' ,
160
+ link : '/zh/guide/advanced/navigation-failures.html' ,
161
+ } ,
162
+ {
163
+ text : '动态路由' ,
164
+ link : '/zh/guide/advanced/dynamic-routing.html' ,
165
+ } ,
166
+ ] ,
167
+ } ,
168
+ {
169
+ items : [
170
+ {
171
+ text : '从 Vue2 迁移' ,
172
+ link : '/zh/guide/migration/index.html' ,
142
173
} ,
143
174
] ,
144
175
} ,
0 commit comments