vuepress icon indicating copy to clipboard operation
vuepress copied to clipboard

Sidebar menu still visible when set to false

Open verdverm opened this issue 3 years ago • 4 comments

  • [x] I confirm that this is an issue rather than a question.

Bug report

Steps to reproduce

Using 2.0.0-beta.35

  1. Create a new site, per the docs page
  2. add the config.js file
  3. set sidebar: false in 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

image

Narrow width

image

Open menu

image

verdverm avatar Feb 16 '22 04:02 verdverm

Have you tried this in .vuepress/config.js?

theme: defaultTheme({
  locales: {
    '/': { sidebar: false }
  }
})

surya-purohit avatar May 18 '22 10:05 surya-purohit

@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

verdverm avatar May 31 '22 21:05 verdverm

This is VuePress 1 repo, please ensure you are using correct version and reading correct docs, VuePress 2 repo are at VuePress/VuePress-next

Mister-Hope avatar Jun 18 '22 07:06 Mister-Hope

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

verdverm avatar Jun 20 '22 13:06 verdverm