Vuetify: navigation-drawer default behavior

Created on 4 Aug 2018  路  5Comments  路  Source: vuetifyjs/vuetify

Currently the default behavior of the navigation-drawer is that it opens when the page is opened wide enough. I'm sure this is a nice option to have, however it would be nice to not have it open at these wider screen widths. I'm having trouble getting it to do what I want and it would be nice if it was easy to change this behavior.

question invalid

Most helpful comment

@erichodges It is easy to control this behavior, you just have to read the docs.

Add the prop called disable-resize-watcher and make the drawer v-model property false by default:

Example:

https://codepen.io/anon/pen/varbpZ?&editors=101

<v-navigation-drawer
  v-model="drawer"
  disable-resize-watcher
>

And then in data() section do this:

drawer: false

All 5 comments

@erichodges It is easy to control this behavior, you just have to read the docs.

Add the prop called disable-resize-watcher and make the drawer v-model property false by default:

Example:

https://codepen.io/anon/pen/varbpZ?&editors=101

<v-navigation-drawer
  v-model="drawer"
  disable-resize-watcher
>

And then in data() section do this:

drawer: false

Please only create issues with the provided templates. In the boilerplate for creating an issue, it explains that any ticket made without this will be automatically closed. Thank you.

Thanks @AlexSHoffman ! I didn't find it in the docs, I looked there first. If you have a moment, please let me know what section covers this. The disable-resize-watcher worked...although now when the drawer is open and I click in the main content area, the drawer no longer closes. I have to click on the hamburger icon to get it to close. How can I fix that?

@KaelWD Sorry, I'll use the template next time :-).

@erichodges you can find all the available API (props) for a component in the API section. Every component page has this section. Scroll the page down a little bit and you will see it:
https://vuetifyjs.com/en/components/navigation-drawers#introduction

As for your second question, again, look in the docs:

  • open the component page
  • scroll down until you see the API section
  • read the description of the props
  • looks like temporary prop is what you need, so add this prop and it will behave the way you need it:
<v-navigation-drawer
  v-model="drawer"
  temporary
  disable-resize-watcher
>

@AlexSHoffman Cool, that worked, thank you! Ok, I will read up on that section, many thanks.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

aaronjpitts picture aaronjpitts  路  3Comments

gluons picture gluons  路  3Comments

paladin2005 picture paladin2005  路  3Comments

jofftiquez picture jofftiquez  路  3Comments

KuroThing picture KuroThing  路  3Comments