R
R
Ruslan2019-09-30 17:33:12
Vue.js
Ruslan, 2019-09-30 17:33:12

How to make v-select width equal to content width in vuetify?

I have this code:

<v-row align="center" justify="space-between">
    <v-col>
        <v-pagination left :length="paginatorPages" v-model="currentPage" :disabled="loadInProgress">
        </v-pagination>
    </v-col>
    <v-col>
        <v-select :items="pagesizes" v-model="filters.pagesize" @change="changePagesize" :disabled="loadInProgress"></v-select>
        </v-col>
    </v-row>

v-select displays items like this: 4,10,20,50,100.
How do I change the code so that the v-select doesn't take up the entire width of the container it's in, but as much as it needs to display its numbers and that it's right-aligned.
and what needs to be done to get the v-pagination to stick to the left edge.
Thank you.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Mr. Grump, 2019-09-30
@Razbezhkin

You can v-colset a prop cols="auto"to tell the columns not to take up all the free space on the axis, but to insert an element between the columns v-spacerthat, on the contrary, will try to take all the free space (in fact, this is where all its tasks end). I can also advise you to hide the invisible inputy v-selectusing styles, it also creates an extra unwanted width

I
Igor, 2019-09-30
@IgorPI

How do I change the code so that the v-select does not take up the entire width of the container it is in, but as much as it needs to display its numbers and so that it is right-aligned.

Yes, there are examples on how to do it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question