diff --git a/README.md b/README.md index 1b7d2c5aaf..31c580ac95 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,6 @@ https://vuepress.vuejs.org/ VuePress is still a work in progress. There are a few things that it currently does not support but are planned: -- Dropdown Items in Navbar - Multi-Language Support - Algolia DocSearch Integration - Blogging support diff --git a/docs/default-theme-config/README.md b/docs/default-theme-config/README.md index 37a871d055..0d64c59ba9 100644 --- a/docs/default-theme-config/README.md +++ b/docs/default-theme-config/README.md @@ -50,6 +50,24 @@ module.exports = { } ``` +These links can also be dropdown menus if you provide nested items via `items`: + +```js +module.exports = { + themeConfig: { + nav: [ + { + text: 'Languages', + items: [ + { text: 'Chinese', link: '/language/chinese' }, + { text: 'Japanese', link: '/language/japanese' } + ] + } + ] + } +} +``` + ## Sidebar To enable the sidebar, use `themeConfig.sidebar`. The basic configuration expects an Array of links: diff --git a/docs/guide/README.md b/docs/guide/README.md index 6c3cdeeccc..0761baa54a 100644 --- a/docs/guide/README.md +++ b/docs/guide/README.md @@ -30,7 +30,6 @@ Each markdown file is compiled into HTML with [markdown-it](https://github.com/m VuePress is still a work in progress. There are a few things that it currently does not support but are planned: -- Dropdown Items in Navbar - Multi-Language Support - Algolia DocSearch Integration - Blogging support diff --git a/lib/default-theme/DropdownLink.vue b/lib/default-theme/DropdownLink.vue new file mode 100644 index 0000000000..cd3796ac66 --- /dev/null +++ b/lib/default-theme/DropdownLink.vue @@ -0,0 +1,152 @@ + + + + + diff --git a/lib/default-theme/NavLink.vue b/lib/default-theme/NavLink.vue new file mode 100644 index 0000000000..626fad52bc --- /dev/null +++ b/lib/default-theme/NavLink.vue @@ -0,0 +1,34 @@ + + + diff --git a/lib/default-theme/NavLinks.vue b/lib/default-theme/NavLinks.vue index d3eab30659..b3bad047f7 100644 --- a/lib/default-theme/NavLinks.vue +++ b/lib/default-theme/NavLinks.vue @@ -1,21 +1,15 @@