vuepress
vuepress copied to clipboard
Sidebar menu still visible when set to false
- [x] I confirm that this is an issue rather than a question.
Bug report
Steps to reproduce
Using 2.0.0-beta.35
- Create a new site, per the docs page
- add the
config.jsfile - set
sidebar: falsein the theme config
What is expected?
That the hamburger menu is not displayed
What is actually happening?
Sidebar is not displayed, but the hamburger button is visible on mobile breakpoints. Looking at the theme code, I think that the showSidebar variable is not passed and available to v-if the hamburger menu. This is in the theme-default/lib/client/layouts/Layout.vue file (in node_modules, can't find where the .
Other relevant information
$ npx vuepress info
System:
OS: Linux 5.10 Debian GNU/Linux 10 (buster) 10 (buster)
CPU: (4) x64 06/8e
Memory: 14.20 GB / 14.21 GB
Shell: 5.0.3 - /bin/bash
Binaries:
Node: 17.5.0 - ~/.config/nvm/versions/node/v17.5.0/bin/node
Yarn: 1.22.4 - ~/.npm-global/bin/yarn
npm: 8.4.1 - ~/.config/nvm/versions/node/v17.5.0/bin/npm
Utilities:
Git: 2.20.1 - /usr/bin/git
Browsers:
Chrome: Not Found
Firefox: Not Found
npmPackages:
@vuepress/bundler-vite: 2.0.0-beta.35
@vuepress/bundler-webpack: Not Found
@vuepress/cli: 2.0.0-beta.35
@vuepress/client: 2.0.0-beta.35
@vuepress/core: 2.0.0-beta.35
@vuepress/markdown: 2.0.0-beta.35
@vuepress/plugin-active-header-links: 2.0.0-beta.35
@vuepress/plugin-back-to-top: 2.0.0-beta.35
@vuepress/plugin-container: 2.0.0-beta.35
@vuepress/plugin-docsearch: Not Found
@vuepress/plugin-external-link-icon: 2.0.0-beta.35
@vuepress/plugin-git: 2.0.0-beta.35
@vuepress/plugin-google-analytics: Not Found
@vuepress/plugin-medium-zoom: 2.0.0-beta.35
@vuepress/plugin-nprogress: 2.0.0-beta.35
@vuepress/plugin-palette: 2.0.0-beta.35
@vuepress/plugin-prismjs: 2.0.0-beta.35
@vuepress/plugin-pwa: Not Found
@vuepress/plugin-pwa-popup: Not Found
@vuepress/plugin-register-components: Not Found
@vuepress/plugin-search: Not Found
@vuepress/plugin-shiki: ^2.0.0-beta.35 => 2.0.0-beta.35
@vuepress/plugin-theme-data: 2.0.0-beta.35
@vuepress/plugin-toc: Not Found
@vuepress/shared: 2.0.0-beta.35
@vuepress/theme-default: 2.0.0-beta.35
@vuepress/utils: 2.0.0-beta.35
vue: 3.2.31
vue-loader: Not Found
vue-router: 4.0.12
vuepress: ^2.0.0-beta.35 => 2.0.0-beta.35
vuepress-vite: 2.0.0-beta.35
vuepress-webpack: Not Found
images
Normal width

Narrow width

Open menu

Have you tried this in .vuepress/config.js?
theme: defaultTheme({
locales: {
'/': { sidebar: false }
}
})
@surya-purohit yes, the issue description mentions that it is explicitly set. The problem is that the value is not checked in all the places it is needed
This is VuePress 1 repo, please ensure you are using correct version and reading correct docs, VuePress 2 repo are at VuePress/VuePress-next
You closed that one as not a bug (see the linked issue above)
I still regard it as a bug, because when I set the menu to not display, per the config, the menu button is still shown
The fix looked to be minimal, and would use the same logic as the menu area component