Skip to content

Commit aa3ad68

Browse files
committed
docs: refine plugin's doc
1 parent fd51d43 commit aa3ad68

16 files changed

+1408
-1461
lines changed

packages/docs/docs/.vuepress/config.js

+22-3
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ module.exports = {
4242
lastUpdated: 'Last Updated',
4343
nav: require('./nav/en'),
4444
sidebar: {
45-
'/guide/': genSidebarConfig('Guide', 'Advanced')
45+
'/guide/': getGuideSidebar('Guide', 'Advanced'),
46+
'/plugin/': getPluginSidebar('Plugin', 'Introduction')
4647
}
4748
},
4849
'/zh/': {
@@ -52,7 +53,8 @@ module.exports = {
5253
lastUpdated: '上次更新',
5354
nav: require('./nav/zh'),
5455
sidebar: {
55-
'/zh/guide/': genSidebarConfig('指南', '深入')
56+
'/zh/guide/': getGuideSidebar('指南', '深入'),
57+
'/zh/plugin/': getPluginSidebar('插件', '介绍')
5658
}
5759
}
5860
}
@@ -71,7 +73,7 @@ module.exports = {
7173
clientRootMixin: path.resolve(__dirname, 'mixin.js')
7274
}
7375

74-
function genSidebarConfig (gruopA, groupB) {
76+
function getGuideSidebar (gruopA, groupB) {
7577
return [
7678
{
7779
title: gruopA,
@@ -98,3 +100,20 @@ function genSidebarConfig (gruopA, groupB) {
98100
}
99101
]
100102
}
103+
104+
function getPluginSidebar (gruopA, introduction) {
105+
return [
106+
{
107+
title: gruopA,
108+
collapsable: false,
109+
children: [
110+
['', introduction],
111+
'writing-a-plugin',
112+
'using-a-plugin',
113+
'life-cycle',
114+
'option-api',
115+
'context-api',
116+
]
117+
},
118+
]
119+
}

packages/docs/docs/.vuepress/nav/en.js

+1-26
Original file line numberDiff line numberDiff line change
@@ -9,32 +9,7 @@ module.exports = [
99
},
1010
{
1111
text: 'Plugin',
12-
items: [
13-
{
14-
text: 'Write a plugin',
15-
link: '/plugin/#writing-a-plugin'
16-
},
17-
{
18-
text: 'Using a plugin',
19-
link: '/plugin/#using-a-plugin'
20-
},
21-
{
22-
text: 'Life Cycle API',
23-
link: '/plugin/#life-cycle-api'
24-
},
25-
{
26-
text: 'Option API',
27-
link: '/plugin/#option-api'
28-
},
29-
{
30-
text: 'Context API',
31-
link: '/plugin/#context-api'
32-
},
33-
{
34-
text: 'Official Plugins',
35-
link: '/plugin/official.html'
36-
}
37-
]
12+
link: '/plugin/'
3813
},
3914
{
4015
text: 'Theme',

packages/docs/docs/.vuepress/nav/zh.js

+1-26
Original file line numberDiff line numberDiff line change
@@ -9,32 +9,7 @@ module.exports = [
99
},
1010
{
1111
text: '插件',
12-
items: [
13-
{
14-
text: '开发插件',
15-
link: '/zh/plugin/#writing-a-plugin'
16-
},
17-
{
18-
text: '使用插件',
19-
link: '/zh/plugin/#using-a-plugin'
20-
},
21-
{
22-
text: '生命周期',
23-
link: '/zh/plugin/#life-cycle-api'
24-
},
25-
{
26-
text: 'Option API',
27-
link: '/zh/plugin/#option-api'
28-
},
29-
{
30-
text: 'Context API',
31-
link: '/zh/plugin/#context-api'
32-
},
33-
{
34-
text: '官方插件',
35-
link: '/zh/plugin/official.html'
36-
}
37-
]
12+
link: '/zh/plugin/'
3813
},
3914
{
4015
text: '主题',

0 commit comments

Comments
 (0)