Vuetify ensures that elements remain in a single row and adjust their size according to the content

I'm trying to create a layout with a single row that has a button aligned to the right edge, and the rest of the space filled with multiple buttons inside a v-chip-group. There are more buttons than can fit in the available space, so I want the v-chip-group to shrink or expand between the left edge and the right button (the v-chip-group component allows you to scroll through the content).

Currently, the right button gets pushed to a new row instead of staying on the same line, and the v-chip-group fills the entire row.

<v-row no-gutters>
   <v-col>
      <v-chip-group>
         <v-btn text @click="goTo(drive)" v-for="drive in drives" :key="drive.name">{{ drive.name }}</v-btn>
         <v-btn text @click="goTo(home)">Home</v-btn>
         <v-btn text v-for="location in favourites" :key="location.name">{{ location.name }}</v-btn>
      </v-chip-group>
   </v-col>
   <v-col>
      <v-btn text><v-icon>mdi-close</v-icon></v-btn>
   </v-col>
</v-row>

Answer №1

It appears that your objective is not completely clear to me, but it seems like you are looking to incorporate the cols property into your columns. By doing so, the rightmost button will stay in place and the chip-group will utilize the maximum available space. This behavior applies across all screen sizes by default. If you wish for the lg breakpoint to behave differently, you can specify a value like lg="6", for instance.

    <v-row no-gutters>
        <v-col cols="11">   <--- this location
          <v-chip-group>
            <v-btn text v-for="drive in drives" :key="drive.name">
              {{ drive.name }}
            </v-btn>
            <v-btn text>Home</v-btn>
            <v-btn text v-for="location in favourites" :key="location.name">
              {{ location.name }}
            </v-btn>
          </v-chip-group>
        </v-col>
        <v-col cols="1">   <---- as well as here
          <v-btn text><v-icon>mdi-close</v-icon></v-btn>
        </v-col>
      </v-row>

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

Retrieving properties from video element following webpage loading

I am trying to access the 'currentSrc' value from a video object in my code. Here is what I have: mounted: function () { this.$nextTick(function () { console.log(document.getElementById('video').currentSrc) }); }, Despi ...

What is the best way to save a PDF from within a frame using JavaScript and an HTML5 <embed> tag?

I'm looking for assistance with a script for my website that dynamically generates a PDF after the user makes selections in one of the frames. The website uses the HTML5 tag to display the PDF file. Can anyone provide guidance on a script that can: ...

What is the process for accessing a local .json file from a remote machine or folder?

I am currently working on a project that involves a .json file stored in my local folder. Along with the file, I have Javascript code in the same directory to access and read the values from the .json file. To open the file, this is the line of code I use: ...

How to make views in React Native adjust their size dynamically in a scrollview with paging functionality

Has anyone successfully implemented a ScrollView in React Native with paging enabled to swipe through a series of images? I am having trouble making the image views fill each page of the scroll view without hardcoding width and height values for the image ...

What are the necessary requirements for executing the command "npm run build"?

What are the requirements for executing npm run build? I am currently working on a Vue project. My goal is to deploy it onto a new server. Will running npm install be sufficient for this purpose? ...

Error message: The method app.get() is invalid as it is not a

I'm having trouble using Express in a prototype function ioServer() { } module.exports = ioServer; ioServer.prototype.start = function() { var app = require('express') var http = require('http').Server(app) ...

Analyze arrays within object properties to identify discrepancies between them

Stuck on a Programming Challenge I am currently working on a project that involves using a JSON file along with express/nodejs, and I have hit a roadblock with a specific task that requires the following steps: Using a post route, the aim is to identify ...

JQuery script fails to load in the head section while dynamically generating an HTML page with JavaScript

Using JavaScript, I have created a new window dynamically and added some HTML code to it. However, when I try to insert a script link into the HTML head, it fails to load when the window is open. <script type="text/javascript"> function newWindo ...

When the onclick function is triggered, two or more characters will be displayed

Functionality: To input name and email, users must click on the virtual keyboard displayed on the screen. Characters entered will be shown in the input box. Implementation: The HTML keyboard interface and associated script have been developed successful ...

What is the best way to position an image alongside text using Vue and Buefy?

I'm looking to add an image next to my text in Vue using Buefy. Take a look at the code I have so far, can someone offer some guidance? <template> <section class="hero is-link is-fullheight-with-navbar"> <div cla ...

"Trying to access the Reducer in a container results in an undefined value

I recently tried adding a new Container to my React App, connected it with Redux, and wanted to test if everything was functioning properly. Unfortunately, when I try to access the reducer using this.props.selection, it returns as undefined. This is puzzli ...

Following the implementation of the YITH ajax navigation filter, my jQuery scripts are no longer functioning as

I'm having trouble with using yith ajax navigation in my theme. Everything works perfectly until I click on an element to filter, at which point my jquery codes stop working. The team at yith suggests: If your product list contains JavaScript cod ...

Different methods to disable scrolling when the mobile menu pops up

I have implemented a mobile menu option that appears when you click on the triple line logo, but unfortunately, users can still scroll while the menu is open. I've tried using position:fixed; but haven't been successful in preventing scrolling be ...

Having trouble with the npm package installation for react-circular-progressbar

I encountered an error when trying to install react-circular-progressbar in my React projects. Why is this happening? npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While resolving: <a href="/cdn-cgi/l/em ...

Is there a way to block form submissions for users who have disabled JavaScript?

Our inquiry form mandates users to input basic information such as their name, location, contact details, and a comment or question. Unfortunately, we have been receiving numerous incomplete forms where essential fields are left blank. It has come to our ...

What options are available to enable the user to input information into the v-time-picker component?

I am looking for a solution where users can input digits into the vuetify v-time-picker, while still being able to select the time on the clock. <v-col align-self="center"> <v-menu ref="menuTimeStart" v-model="me ...

What steps should I take to create a plugin for a library if defining it as a peerDependency does not provide a specific implementation for me to work with?

Requirements for My Plugin: I'm currently in the process of developing a new plugin that is dependent on popularLibrary.js. Here are the key points about my plugin: It will not function properly if popularLibrary.js is missing. It is designed to wo ...

Issue encountered while attempting to open image file - Vuejs

While trying to load an image file using Vue.js, I encountered the following error: [Vue warn]: Error in event handler for "change": "TypeError: Cannot read property 'files' of undefined" Another error that popped up reads as follows. How can ...

What are the steps to adjust the size of the Facebook "like" button?

Is there a way to modify the size of the Facebook like button? I attempted to adjust the padding of <a class="connect_widget_like_button clearfix like_button_no_like"> using jQuery, but was unsuccessful. Any suggestions on how this can be achieved? ...

Discover the process for breaking down JSON data into separate stages using the Express API

My API architecture is causing a problem as I try to insert it into an array called items[]. https://i.stack.imgur.com/qe802.png The setup involves a simple API built on express + mongodb. The challenge lies in figuring out how to store data from the pos ...