The v-navigation-drawer
component is what your users will utilize to navigate through the application. The navigation-drawer is pre-configured to work with or without vue-router right out the box. For the purpose of display, some examples are wrapped in a v-card
element. Within your application you will generally place the v-navigation-drawer
as a direct child of v-app
.
If you are using v-navigation-drawer
with app
property enabled, you don't need to use absolute
prop as in examples.
Wählen Sie unten Ihren gewünschte Komponente aus und sehen Sie die verfügbaren Attribute, Slots, Ereignisse und Funktionen.
Wendet den Style position: absolute auf einer Komponente an.
Bezeichnet die Komponente als Teil des Anwendungslayouts. Wird zum dynamischen Anpassen der Inhaltsgröße verwendet. Komponenten, die diese Props verwenden, sollten sich outside der v-main
-Komponente befinden, damit sie ordnungsgemäß funktionieren. Weitere Informationen zu Layouts finden Sie auf der [Anwendungsseite] (/components/application). Hinweis: Diese Props wendet automatisch position: fixed auf das Layoutelement an. Sie können diese Funktionalität mit der Props absolute
überschreiben
Expands from the bottom of the screen on mobile devices
A clipped drawer rests under the application toolbar
Wendet eine bestimmte Farbe für die Steuerung an - es kann der Name der Materialfarbe sein (zum Beispiel success
oder purple
) oder css-Farben (#033
oder rgba(255, 0, 0, 0.5)
). Sie finden eine Liste der eingebauten Klassen auf der Farbseite.
Wendet die dunkle Theme-Variante für die Komponente an. Mehr Informationen zur Material Design Dokumentation für dunkle Themes.
Will automatically open/close drawer when resized depending if mobile or desktop.
Disables opening of navigation drawer when route changes
Collapses the drawer to a mini-variant until hovering with the mouse
Wendet den Style position: fixed auf einer Komponente an.
A floating drawer has no visible container (no border-right)
Sets the height of the navigation drawer
Versteckt das Overlay.
Wendet die helle Theme-Variante für die Komponente an.
Condenses navigation drawer width, also accepts the .sync modifier. With this, the drawer will re-open when clicking it
Designates the width assigned when the mini
prop is turned on
Sets the designated mobile breakpoint for the component. This will apply alternate styles for mobile devices such as the temporary
prop, or activate the bottom
prop when the breakpoint value is met. Setting the value to 0
will disable this functionality.
Legt die Überlagerungsfarbe fest.
Legt die Deckkraft des Overlays fest.
The drawer remains visible regardless of screen size
Places the navigation drawer on the right
Specifies a v-img as the component's background.
Remove all automated state functionality (resize, mobile, route) and manually control the drawer state
Specify a custom tag used on the root element.
A temporary drawer sits above its application and uses a scrim (overlay) to darken the background
Disable mobile touch functionality
Legt fest, ob die Komponente sichtbar oder versteckt ist.
Legt die Breite für den Component fest.
A slot at the bottom of the drawer
Der Standard-Vue Slot.
Used to modify v-img
properties when using the src prop
{
height: string
src: string | srcObject
}
A slot at the top of the drawer
Das aktualisierte gebundene Modell
boolean
Emits event object when transition is complete.
object
The mini-variant.sync
event
boolean
1px !default;
16 !default;
Unten finden Sie eine Sammlung einfacher bis komplexer Beispiele.
Navigation drawers can be customized to fit any application's design. Here we apply a custom background color and an appended content area using the append slot.
By default, a navigation drawer has a 1px right border that separates it from content. In this example we want to detach the drawer from the left side and let it float on its own. The floating property removes the right border (or left if using right).
When using the mini-variant prop, the drawer will shrink (default 56px) and hide everything inside of v-list
except the first element. In this example we use the .sync modifier that allows us to tie the expanding/contracting of the drawer programmatically.
A temporary drawer sits above its application and uses a scrim (overlay) to darken the background. This drawer behavior is mimicked by default when on mobile. Clicking outside of the drawer will cause it to close.
Navigation drawers can also be positioned on the right side of your application (or an element). This is also useful for creating a side-sheet with auxillary information that may not have any navigation links. When using RTL you must explicitly define right for your drawer.
Places the component in mini-variant mode and expands once hovered. Does not alter the content area. To have content area respond to expand-on-hover bind mini-variant.sync to a boolean. Width can be controlled with the mini-variant-width property.
Apply a custom background to your drawer. If you need to customize v-img
's properties you can use the img slot.
In this example we define a custom width to accommodate our nested drawer. Using v-row
we ensure that the drawer and list stack horizontally next to each other.
Using the bottom prop, we are able to relocate our drawer on mobile devices to come from the bottom of the screen. This is an alternative style and only activates once the mobile-breakpoint is met.
Bereit für mehr? Weiter lesen mit: