Skip to content

Commit

Permalink
docs(VAppBar): add nav drawer toggle example
Browse files Browse the repository at this point in the history
resolves #9147
  • Loading branch information
MajesticPotatoe committed Feb 4, 2020
1 parent da7411a commit 38beecb
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/docs/src/data/pages/components/AppBars.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
"simple/collapse",
"simple/elevate-on-scroll",
"simple/inverted-scroll",
"intermediate/app-bar-nav",
"intermediate/scroll-threshold",
"complex/img-fade",
"complex/menu"
Expand Down
54 changes: 54 additions & 0 deletions packages/docs/src/examples/app-bars/intermediate/app-bar-nav.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<template>
<v-card
class="mx-auto overflow-hidden"
height="400"
>
<v-app-bar
color="deep-purple"
dark
>
<v-app-bar-nav-icon @click="drawer = true"></v-app-bar-nav-icon>

<v-toolbar-title>Title</v-toolbar-title>
</v-app-bar>

<v-navigation-drawer
v-model="drawer"
absolute
temporary
>
<v-list
nav
dense
>
<v-list-item-group
v-model="group"
active-class="deep-purple--text text--accent-4"
>
<v-list-item>
<v-list-item-icon>
<v-icon>mdi-home</v-icon>
</v-list-item-icon>
<v-list-item-title>Home</v-list-item-title>
</v-list-item>

<v-list-item>
<v-list-item-icon>
<v-icon>mdi-account</v-icon>
</v-list-item-icon>
<v-list-item-title>Account</v-list-item-title>
</v-list-item>

</v-list-item-group>
</v-list>
</v-navigation-drawer>
</v-card>
</template>

<script>
export default {
data: () => ({
drawer: false,
}),
}
</script>
4 changes: 4 additions & 0 deletions packages/docs/src/lang/en/components/AppBars.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
"heading": "### Hiding on scroll",
"desc": "`v-app-bar` can be hidden on scroll. Use the `hide-on-scroll` property for this."
},
"app-bar-nav": {
"heading": "### Toggle Navigation Drawers",
"desc": "Using the functional component `v-app-bar-nav-icon` you can toggle the state of other components such as a [v-navigation-drawer](/components/navigation-drawer)."
},
"scroll-threshold": {
"heading": "### Scroll threshold",
"desc": "`v-app-bar` can have scroll threshold. It will start reacting to scroll only after defined via `scroll-threshold` property amount of pixels."
Expand Down

0 comments on commit 38beecb

Please sign in to comment.