The functionality of both v-navigation-drawer and v-app-bar is not behaving as expected

I am struggling with aligning my v-navigation-drawer component under my v-app-bar component in my simple app bar and navigation drawer page. The official vuetify documentation provides a clear example of how the layout should look (Example). See https://i.sstatic.net/EeVbJ.png

I aim to achieve the official layout as it is more visually appealing than what I currently have. Despite trying various props on both the v-app-bar and v-navigation-drawer components, I have not been able to achieve the desired outcome.

EDIT: My code is being loaded as a component in my main App.vue

This is my current code:

<template>
  <div>
    <v-app-bar app clipped-leftS flat dark>
      <v-toolbar-title>
        <span class="first-word font uppercase">hi</span>
        <span class="second-word font uppercase">stackoverflow</span>
      </v-toolbar-title>
      <v-spacer></v-spacer>
    </v-app-bar>

    <v-navigation-drawer app flat dark mini-variant permanent expand-on-hover>
      <v-list>
        <v-list-item class="px-2">
          <v-list-item-avatar>
            <v-img src="https://randomuser.me/api/portraits/men/11.jpg"></v-img>
          </v-list-item-avatar>

          <v-list-item-title>John Doe</v-list-item-title>
        </v-list-item>
        <v-list-item v-for="item in navbarlist" :key="item.route" :to="item.route">
          <v-list-item-icon>
            <v-icon>{{ item.icon }}</v-icon>
          </v-list-item-icon>
          <v-list-item-content>{{ item.text }}</v-list-item-content>
        </v-list-item>
      </v-list>
    </v-navigation-drawer>
  </div>
</template>

<script>
export default {
  data: () => ({
    navbarlist: [
      { icon: "mdi-view-dashboard", text: "Dashboard", route: "/" },
      { icon: "mdi-upload", text: "Upload", route: "/upload" },
    ],
  }),
};
</script>

<style>
.font {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
}
.uppercase {
  text-transform: uppercase;
}
.first-word {
  font-weight: 400;
}
.second-word {
  font-weight: 200;
  color: grey;
}
.item-tile-icon {
  color: black;
}
</style>

Answer №1

I resolved the issue by inserting clipped into my v-navigation-drawer element.

Here is how my updated code looks:

<template>
  <div>
    <v-app-bar app clipped-left flat dark>
      <v-toolbar-title>
        <span class="first-word font uppercase">hi</span>
        <span class="second-word font uppercase">stackoverflow</span>
      </v-toolbar-title>
      <v-spacer></v-spacer>
    </v-app-bar>

    <v-navigation-drawer app clipped flat dark expand-on-hover>
      <v-list>
        <v-list-item class="px-2">
          <v-list-item-avatar>
            <v-img src="https://randomuser.me/api/portraits/men/11.jpg"></v-img>
          </v-list-item-avatar>

          <v-list-item-title>John Doe</v-list-item-title>
        </v-list-item>
        <v-list-item v-for="item in navbarlist" :key="item.route" :to="item.route">
          <v-list-item-icon>
            <v-icon>{{ item.icon }}</v-icon>
          </v-list-item-icon>
          <v-list-item-content>{{ item.text }}</v-list-item-content>
        </v-list-item>
      </v-list>
    </v-navigation-drawer>
  </div>
</template>

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Utilize the v-for second argument in VueJS 2 to showcase the index and index+1

For a VueJS 2 project, I am tasked with enhancing the display of the first and second elements in an array by making them stand out from the rest. To achieve this, I am utilizing the v-for syntax to iterate over a child component within a parent component. ...

Ways to implement a delay in a function?

I'm looking for a way to introduce a delay in my function. Should I enclose the function within a delay function, or is there a different method to ensure that the animation doesn't trigger until 5 seconds after the page has loaded? var textTo ...

Having trouble accessing Kotlin JS from JavaScript

I'm currently experiencing an issue where I am unable to call any Kotlin JS function and receiving an error stating that 'something' is not defined. Initially, I attempted compiling the project with Gradle but found success after following ...

Unable to set or select options using JavaScriptExecutor in C# Selenium

Below is a snippet of HTML code: <div class="k-list-scroller" unselectable="on" style="height: auto;"> <ul unselectable="on" class="k-list k-reset" tabindex="-1" aria-hidden="true" id="AdmittedFromId_listbox" aria-live="off" data-role="static ...

Using Various Interactive Canvases with HTML5

I am currently working on a website project that requires multiple canvases to encircle individual images. After experimenting with HTML, CSS, and JS on JSfiddle, I successfully achieved the desired effect with a single image. However, when I duplicated t ...

Tips for automatically updating a start and end page input field

In my project, I am working with a list of start and end page numbers using angularJS forms. One specific feature I want to implement is the automatic updating of start page values based on the previous end page. For example, if a user enters '4' ...

Is there a way to match a string with information stored in a JSON file?

I have a snippet in my index.js that looks like this: if ('and' == trueWords) { console.log('Success!') } else { console.log('Failure!') } Below is the content of my json file: { "and": 1 } Appreciate your help! ...

Transform coordinated universal time to the corresponding local time using Angular

Looking to transform the UTC format date into an India date and time format using Angular 2019-02-18T17:31:19-05:00 I am looking for it to be in the following format: DD/MM/YYYY HH:MM(eg: 02/19/2019 04:01 AM). Any guidance on how to accomplish this would ...

Sharing data between functions in JavaScript allows for more flexible and interdependent code structure

After invoking the Showmenu() JavaScript function from C# and passing a variable to it, there is a need to utilize this variable in another JavaScript function. <script type="text/javascript" > var strmenu; function ShowMenu(strmenu) { alert(str ...

The setAttribute method does not function with getElementByClass()

Can someone please help me understand why this code is not working for me: document.getElementByClass('home1').setAttribute('style', 'background-image:url(img/red_menu.PNG);'); I have confirmed that I do indeed have an eleme ...

Choose a numeric value and then adjust it to display with exactly two decimal places

My goal is to create a code that achieves the following tasks: Add an ID to every nth child Round the number in each nth child to 2 decimal places Prefix the numbers with a pound sign (£) Loop through until all the nth children in a table are processed ...

The result of calling toLocaleString on an array is an empty string when followed by join or toString methods

It's puzzling that calling the join and toString methods on an Array object results in an empty string after using toLocaleString: let A = [1, 2, 3]; A.toString(); => "1,2,3" A.join(); => "1,2,3" A => (3) [1, 2, 3] A.toLocaleString(); => ...

What is the best way to access and modify a nested object within a complex object containing an array of objects?

I've got the course structure all sorted out, but I'm struggling to understand how to retrieve a lesson object by its ID and also update a lesson object with new property values. If anyone could provide some guidance on the right approach, it wo ...

Shader in THREE.js only appears when the window is resized

I recently started working with THREE.js and have been experimenting with shaders. Strangely, I've noticed that this particular shader only displays correctly when I resize the window. You can find the code here. Any ideas on why it's behaving th ...

What could be causing my select tags to appear incorrectly in Firefox and IE?

With the help of Jquery, my goal is to dynamically populate a select field when it is in focus, even if it already has a value. Once populated, I want to retain the previous value if it exists as an option in the newly populated field. Although this works ...

Why does my POST request result in [object Object] being returned?

I am just starting to learn AngularJS and I am unsure if my POST request is functioning correctly. After making the request, I am receiving an [object Object] response. What does this error indicate? Could it be related to an issue with the form? //Acti ...

The Nuxt.js and Vue.js Watchers are caught in an infinite loop caused by fluctuations in the values

Currently, I am working on a project using Nuxt.js/Vue.js for creating an application that can efficiently convert XML to JSON and vice versa. Users have the ability to input values into textareas, which are managed by CodeMirror. The textarea is connecte ...

Angular examine phrases barring the inclusion of statuses within parentheses

I require some assistance. Essentially, there is a master list (arrList) and a selected list (selectedArr). I am comparing the 'id' and 'name' from the master list to those in the selected list, and then checking if they match to determ ...

Are you interested in triggering a personalized event when attempting to sort data in Datatables?

Is there a way to trigger my own event without sorting when the user clicks on a column header? I have looked into different methods, but none seem to be suitable for this purpose. Although I can bind to the sort event to perform custom actions, the sorti ...

Error: material not being loaded by objloader

I recently started working with Three.js and encountered an issue while loading an obj object into my scene. The object loads successfully, but the materials are not provided by the MTLLoader. I'm unsure if my object is broken or if there is an issue ...