How to centrally align Vuetify's dropdown menu with the button

Below is a drop-down menu with two rows of v-list items:

<v-menu
  class="dropdown"
  open-on-hover
  offset-y
>
  <template v-slot:activator="{ on, attrs }">
    <v-btn
      class="rounded-xl green darken-3 text-capitalize elevation-2 ml-2"
      dark
      v-bind="attrs"
      v-on="on"
    >
      The Society
    </v-btn>
  </template>

  <v-list class="pa-6">
    <v-list-item>
      <v-row>
        <v-col cols="12" sm="6">
          <h1 class="display-1 orange--text">Important Info</h1>
          <v-divider class="ma-3"></v-divider>
          <v-list-item><v-btn class="ml-n6" text>Our Constitution <v-icon class="ml-3">mdi-security</v-icon></v-btn></v-list-item>
          <v-list-item class="body-2" to="/">Lorem ipsum.</v-list-item>
          <v-list-item class="body-2" to="/">Lorem ipsum.</v-list-item>
          <v-list-item class="body-2" to="/">Lorem ipsum.</v-list-item>
          <v-list-item class="body-2" to="/">Lorem ipsum.</v-list-item>
        </v-col>
        <v-divider vertical></v-divider>
        <v-col cols="12" sm="6">
          <h1 class="display-1 orange--text">Important Info</h1>
          <v-divider class="ma-3"></v-divider>
          <v-list-item class="body-2" to="/">Lorem ipsum.</v-list-item>
          <v-list-item class="body-2" to="/">Lorem ipsum.</v-list-item>
          <v-list-item class="body-2" to="/">Lorem ipsum.</v-list-item>
          <v-list-item class="body-2" to="/">Lorem ipsum.</v-list-item>
        </v-col>
             </v-row>
    </v-list-item>
  </v-list>
</v-menu>

I want the dropdown menu to open centered to the The Society button instead of pushing to the right. The middle line of the drop-down should align with the center of the The Society button.

https://i.stack.imgur.com/FMEMW.png

Answer №1

It appears that there is a convenient nudge-left API feature available for v-menu components. Many thanks to Vuetify for providing such an exceptional framework!

Here's the code snippet I used:

<v-menu
      open-on-hover
      nudge-left="220"
      nudge-bottom="50"
    >

This adjustment seems to have resolved my issue successfully.

You can find more information about the API here: https://vuetifyjs.com/en/api/v-menu/#props

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

The functionality of Highcharts-more.js is not functioning properly within a project set up using vue-cli

Recently, I have been working on a vue-cli project and attempting to create a polar chart similar to the one shown here: To achieve this, I needed to install and import the highcharts and highchart-more libraries using npm. However, upon importing both fi ...

Guide to resolving a blank webpage issue post running 'npm run build'

I am currently in the process of working on a project that involves Vue and Firebase. Unfortunately, I have encountered an issue where my development server is no longer rendering new routes from my Vue router after building and deploying to production. F ...

Not suitable for Heroku deployment

I have been attempting to deploy this Nuxt.js application on Heroku in universal mode. Following the necessary steps like "npm run build" and "npm run start" for production mode, everything seemed to be working smoothly. Next, I executed the following co ...

When setting up Vue.js for unit testing, the default installation may show a message stating that

Recently set up a fresh Vue project on Windows 7 using the VueJS UI utility. Unit testing with Jest enabled and added babel to the mix. However, when running "npm test" in the command line, an error is returned stating 'Error: no test specified' ...

Establishing communication sessions with Express.js server and Vue.js client

I have encountered an issue with my project setup. I am utilizing an expressJS server to create a REST api server and a VueJS client using VueCLI. Folder Layout : .root ├── _server | ├── Files related to the server ├── _client | ├ ...

Encountering issues with npm installation on a Linux operating system

Embarking on a new journey learning Vue.js, I find myself in unchartered territory with Node.js. Initially, when I cloned the repository for my course and followed the setup instructions, everything ran smoothly without any issues. However, a blunder on my ...

Error: Nuxt not detected within the Docker container

I'm creating a docker setup for a nuxt 3 application. Here is my package.json configuration: { "private": true, "scripts": { "start": "nuxt start", "build": "nuxt build", &quo ...

How can I retrieve server-side data in the client-side using NodeJs (connecting to MySql) with Vue CRUD?

Currently, I am delving deeper into Vue and to make the learning process more engaging, I have established a connection to my MySql-DB using nodeJS. Following a detailed tutorial (), I successfully implemented a Login system. Now, my goal is to retrieve d ...

Error occurs when using Express.js in combination with linting

https://www.youtube.com/watch?v=Fa4cRMaTDUI I am currently following a tutorial and attempting to replicate everything the author is doing. At 19:00 into the video, he sets up a project using vue.js and express.js. He begins by creating a folder named &apo ...

Vue-ctl project creation halted by operating system rejection

While working on a Vue-CLI project, I encountered an issue. Has anyone else faced this problem before? Operating system: Windows 10 - Command Prompt (admin rights) @vue-cli version: 4.5.4 npm version: 6.14.6 Here is the command I ran: vue create font_ ...

The ideal structure for a Vue app

As a newcomer to Vue, I've been exploring different guidelines on how to use it effectively. In one resource here, the project was structured with separate directories for assets, components, routes, services, and views within a 'src' direct ...

`vue-template-compiler package.json module not found in each new project``

After transitioning from Linux to Windows and setting up a programming environment, I encountered an issue that I didn't remember facing on Linux. Here are the steps I took: 1. Installed Node.js 2. Ran npm install -g @vue/cli for CLI installation 3. C ...

SMTPConnection._formatError experienced a connection timeout in Nodemailer

Our email server configuration using Nodemailer SMTP settings looked like this: host: example.host port: 25 pool: true maxConnections: 2 authMethod: 'PLAIN' auth: user: 'username' pass: 'pass' We encou ...

`Finding the nodejs API route for displaying images from a database`

How can I successfully display an image from the database without getting a string of question marks instead? Click here to see the issue >>> When attempting to directly call the API using the provided link, the following result is returned: {&qu ...

I encountered an issue while trying to start my Nuxt project - facing difficulty in resolving 'fsevents' within the project directory

Whenever I start my nuxt.js project using npm run dev, I encounter compilation errors: × Client Compiled with some errors in 12.53s WARN Compiled with 2 warnings ...

Encountering a problem while running npm build (PostCSS plugin postcss-purgecss needs PostCSS 8) on vuejs3 with tailwind

I'm currently in the process of developing an application using Vue.js 3 and Tailwind CSS. While testing some configurations before diving into the project, I encountered a specific error message when running npm run build: ERROR Failed to compile wit ...

Load data from a file into a dropdown menu using node.js

Exploring the realm of front end development on my own has been quite a challenge. I am currently struggling with the concept of populating a drop down box with data from a file. While utilizing node and JavaScript, I have decided to stick to these techn ...

The installation of npm was unsuccessful due to an error: npm encountered an invalid JSON response

Warning: Peer dependency overridden by npm. Found: [email protected] in node_modules/@ivan/data-insights/node_modules/bootstrap. Bootstrap@^3.3.7 from @ivan/[email protected] version 1.7.26. Could not resolve dependency because peer bootstrap@^4.3.1 nee ...

Guide to utilizing Terser in conjunction with webpack

I am currently using Webpack 6.10.2 in combination with Vue 3.9.3. I encountered an issue with Uglify.js when running npm run build due to its inability to handle ES6 code. To work around this problem, I followed the recommendation of removing Uglify fro ...

Leveraging Environment Variables in Vue.js

I've been diving into the official documentation, but haven't come across any information regarding environment variables. While there are community projects that offer support for this feature, they seem a bit excessive for my needs. I'm cu ...