Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit d2419d0

Browse files
committedApr 16, 2018
docs: document sub groups in nav dropdown
1 parent 686d3d1 commit d2419d0

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed
 

‎docs/default-theme-config/README.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,14 @@ module.exports = {
5050
}
5151
```
5252

53-
These links can also be dropdown menus if you provide nested items via `items`:
53+
These links can also be dropdown menus if you provide an array of `items` instead of a `link`:
5454

5555
```js
5656
module.exports = {
5757
themeConfig: {
5858
nav: [
5959
{
60-
text: 'Languages',
60+
text: 'Languages',
6161
items: [
6262
{ text: 'Chinese', link: '/language/chinese' },
6363
{ text: 'Japanese', link: '/language/japanese' }
@@ -68,6 +68,24 @@ module.exports = {
6868
}
6969
```
7070

71+
In addition, you can have sub groups inside a dropdown by having nested items:
72+
73+
```js
74+
module.exports = {
75+
themeConfig: {
76+
nav: [
77+
{
78+
text: 'Languages',
79+
items: [
80+
{ text: 'Group1', items: [/* */] },
81+
{ text: 'Group2', items: [/* */] }
82+
]
83+
}
84+
]
85+
}
86+
}
87+
```
88+
7189
## Sidebar
7290

7391
To enable the sidebar, use `themeConfig.sidebar`. The basic configuration expects an Array of links:

0 commit comments

Comments
 (0)
Please sign in to comment.