I have a dashboard that contains tiles in 3 rows, each row contains 5 tiles. Like the below picture
I am using the below code for tiles:
<v-layout row wrap>
<v-flex xs12 sm8 md4 lg4 xl4 class="lg5-custom pl-0 pb-0 tiles-cursor">
<v-card flat tile class="d-flex">
<v-img :src="require('img_url')" aspect-ratio="1" class="grey lighten-2">
</v-img>
<div class="content">
<h3 align="center">A</h3>
</div>
</v-card>
</v-flex>
<v-flex xs12 sm8 md4 lg4 xl4 class="lg5-custom pl-0 pb-0 tiles-cursor">
<v-card flat tile class="d-flex">
<v-img :src="require('img_url')" aspect-ratio="1" class="grey lighten-2">
</v-img>
<div class="content">
<h3 align="center">A</h3>
</div>
</v-card>
</v-flex>
... so on
</v-layout>
Below is my CSS code to customize the tiles:
#media (min-width: 1264px) and (max-width: 1903px) {
.flex.lg5-custom {
width: 20%;
max-width: 20%;
flex-basis: 20%;
}
.flex.lg10-custom {
width: 40%;
max-width: 40%;
flex-basis: 40%;
}
}
Even small screen sometimes 3rd row last tiles don't support.
.flex.lg10-custom CSS used for 3rd rows last tile.
I wanted to support this landing page for all screen (especially large screen). Any idea?
So, I have resolved it by using v-row and v-col instead of v-flex. However, all the tiles got small compare to the previous one because the entire row size is 12 and I divided by 5 so, that I can only utilize only 10, not 12. I had to leave 1 from left and 1 from the right to make it center. Below is my code:
<v-container fluid>
<v-row justify="center">
<v-col cols="2" class="pb-1 pt-1 pl-1 pr-1">
<v-card elevation="23" class="secondary ml-0 mr-0 mt-0 mb-0 change-mouse-pointer">
<v-img :src="require('img_url')" aspect-ratio="1" class="grey lighten-2">
</v-img>
<div class="content">
<h3 align="center">A</h3>
</div>
</v-card>
</v-col>
<v-col cols="2" class="pb-1 pt-1 pl-1 pr-1">
<v-card elevation="23" class="secondary ml-0 mr-0 mt-0 mb-0 change-mouse-pointer">
<v-img :src="require('img_url')" aspect-ratio="1" class="grey lighten-2">
</v-img>
<div class="content">
<h3 align="center">A</h3>
</div>
</v-card>
</v-col>
... so on
</v-row>
.... last row last col
<v-row justify="center">
... first 3 will be the same as before
<v-col cols="4" class="pb-1 pt-1 pl-1 pr-1">
<v-card elevation="23" class="secondary d-flex" height="50%">
<v-img :src="require('img_url')" aspect-ratio="1" class="grey lighten-2">
</v-img>
<div class="content">
<h3 align="center">A</h3>
</div>
</v-card>
</v-col>
</v-row>
</v-container>
If anyone wants the full solution, please comment below.
Related
In a Vue 2 SPA I use Vuetify. On the home page I have a carousel that auto cycles through 3 v-carousel-items. For the first cycle of the v-carousel the viewport jumps to the carousel on cycling. The desired behaviour is for the carousel to continue cycling but not to pull the viewport. Weirdly it happens in Chrome but not in Firefox. I found a similiar problem adressed in https://www.programmersought.com/article/15814769396/.
<v-carousel
progress
:progress-color="secondColorComputed"
interval=7000
cycle
height="750px"
class="mx-auto ; my-4 ;"
show-arrows-on-hover>
<v-carousel-item
transition="false"
reverse-transition="false">
<v-card width="90%" class="mx-auto ; black--text" shaped :color="colorComputed">
<v-card-title>Sub Seasonal Outlook</v-card-title>
<!-- <v-container fluid> -->
<v-row align="center" justify="center">
<v-card width="50%">
<v-img
alt="GIF 1"
class="shrink"
contain
src="https://hpfx.collab.science.gc.ca/~svfs000/na-vfsp-was/public/assets/geps/ss-precip.png"
width="800"/>
</v-card>
<v-spacer></v-spacer>
<v-card width="50%">
<v-img
alt="GIF 2"
class="shrink"
contain
src="https://hpfx.collab.science.gc.ca/~svfs000/na-vfsp-was/public/assets/geps/ss-temp.png"
width="800"/>
</v-card>
</v-row>
<!-- </v-container> -->
<v-btn :color="secondColorComputed" to="/forecasts/sub-seasonal-outlook">More</v-btn>
</v-card>
</v-carousel-item>
<v-carousel-item
transition="false"
reverse-transition="false">
<v-card width="90%" class="mx-auto ; black--text" shaped :color="colorComputed">
<v-card-title>Multi Model Ensemble 03H Continental USA</v-card-title>
<!-- <v-container fluid> -->
<v-row align="center" justify="center">
<v-spacer/>
<v-card width="75%">
<v-img
alt="GIF 1"
class="shrink"
contain
src="https://hpfx.collab.science.gc.ca/~svfs000/na-vfsp-was/public/assets/mme-pm25-combined/conUS-pm25-03.png"
/>
</v-card>
<v-spacer/>
</v-row>
<!-- </v-container> -->
<v-btn :color="secondColorComputed" to="/forecasts/multi-model-ensemble">More</v-btn>
</v-card>
</v-carousel-item>
<v-carousel-item
transition="false"
reverse-transition="false">
<v-card width="90%" class="mx-auto ; black--text" shaped :color="colorComputed">
<v-card-title>Fire Weather Index 24H</v-card-title>
<!-- <v-container fluid> -->
<v-row align="center" justify="center">
<v-spacer/>
<v-card width="50%">
<v-img
alt="GIF 1"
class="shrink mr-2"
contain
src="https://hpfx.collab.science.gc.ca/~svfs000/na-vfsp-was/public/assets/fwi/fwi-24.png"
width="800"/>
</v-card>
<v-spacer/>
</v-row>
<!-- </v-container> -->
<v-btn :color="secondColorComputed" to="/forecasts/fire-weather-index">More</v-btn>
</v-card>
</v-carousel-item>
</v-carousel>
I'm not sure if it's exactly the same issue as what you're having, but I had a problem with the page jumping up to the carousel on slide change, and managed to get it to stop doing this by setting the wrapper to have no height. (I'm using the fade animations.)
.v-window__container {
height: 0;
}
Mine issue got resolved by replacing transition to fade transition.
<v-carousel :cycle="true" interval="3000">
<v-carousel-item
v-for="(item,i) in items"
:key="i"
:src="item.src"
fade
></v-carousel-item>
I'm new to Vue and Vuetify and I'm trying to build a login screen. I can't get v-img to center inside of v-flex. I've tried a lot of things, but am really stuck. I'm referring to the Vue logo in the right v-flex.
I can't get the snippet to show exactly as the image above, but I don't think it really matters as the Vue logo isn't centered either in the snippet. If there is a better way to create the setup as shown in the image I would really like to know. As I said, i'm new to this and still learning.
new Vue({
el: '#app',
vuetify: new Vuetify(),
data: () => ({
showPassword:false
}),
})
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.6.11/vue.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vuetify/2.3.2/vuetify.min.js"></script>
<link href="https://unpkg.com/vuetify/dist/vuetify.min.css" rel="stylesheet"/>
<div id="app">
<v-app style="
background-color: #011c40;
background-image: linear-gradient(180deg, #011c40 50%, rgb(26, 65, 115) 100%);
background-size: cover;
">
<v-main>
<v-container class="fill-height"
fluid>
<v-row>
<v-col cols="12">
<v-row
justify="center"
>
<v-card tile>
<v-layout align-center>
<v-flex xs6 class="hidden-sm-and-down">
<v-img src="http://www.dpereira.nl/Er/img/banner.png" width="500px"></v-img>
</v-flex>
<v-flex class="pa-10 pb-8 text-center">
<v-img class="" src="https://cdn.vuetifyjs.com/images/logos/vuetify-logo-dark.png" width="100px"></v-img>
<v-card-text class="pb-0">
<v-form>
<v-text-field
label="Gebruikersnaam"/>
<v-text-field
:type="showPassword ? 'text' : 'password'"
label="Wachtwoord"
:append-icon="showPassword ? 'mdi-eye' : 'mdi-eye-off'"
#click:append="showPassword = !showPassword"
/>
<v-checkbox dense label="Onthoud mij"></v-checkbox>
</v-form>
</v-card-text>
<v-card-actions>
<v-btn height="50px" tile ripple depressed block color="secondary">Inloggen</v-btn>
</v-card-actions>
<v-divider></v-divider>
<div class="pt-3">
<div class="d-block caption text-center">Wachtwoord vergeten?</div>
<div class="d-block caption text-center">Nog geen account? Meld u hier aan.</div>
</div>
</v-flex>
</v-layout>
</v-card>
</v-row>
</v-col>
</v-row>
</v-container>
</v-main>
</v-app>
</div>
EDIT: I have added mx-auto class on v-img, now it's working as intended.
new Vue({
el: '#app',
vuetify: new Vuetify(),
data: () => ({
showPassword:false
}),
})
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.6.11/vue.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vuetify/2.3.2/vuetify.min.js"></script>
<link href="https://unpkg.com/vuetify/dist/vuetify.min.css" rel="stylesheet"/>
<div id="app">
<v-app style="
background-color: #011c40;
background-image: linear-gradient(180deg, #011c40 50%, rgb(26, 65, 115) 100%);
background-size: cover;
">
<v-main>
<v-container class="fill-height"
fluid>
<v-row>
<v-col cols="12">
<v-row
justify="center"
>
<v-card tile>
<v-layout align-center>
<v-flex xs6 class="hidden-sm-and-down">
<v-img src="http://www.dpereira.nl/Er/img/banner.png" width="500px"></v-img>
</v-flex>
<v-flex class="pa-10 pb-8 text-center">
<v-img class="mx-auto" src="https://cdn.vuetifyjs.com/images/logos/vuetify-logo-dark.png" width="100px"></v-img>
<v-card-text class="pb-0">
<v-form>
<v-text-field
label="Gebruikersnaam"/>
<v-text-field
:type="showPassword ? 'text' : 'password'"
label="Wachtwoord"
:append-icon="showPassword ? 'mdi-eye' : 'mdi-eye-off'"
#click:append="showPassword = !showPassword"
/>
<v-checkbox dense label="Onthoud mij"></v-checkbox>
</v-form>
</v-card-text>
<v-card-actions>
<v-btn height="50px" tile ripple depressed block color="secondary">Inloggen</v-btn>
</v-card-actions>
<v-divider></v-divider>
<div class="pt-3">
<div class="d-block caption text-center">Wachtwoord vergeten?</div>
<div class="d-block caption text-center">Nog geen account? Meld u hier aan.</div>
</div>
</v-flex>
</v-layout>
</v-card>
</v-row>
</v-col>
</v-row>
</v-container>
</v-main>
</v-app>
</div>
You could also use flex box to center the content (adjusting the container height for vertical alignment)
<v-container fluid>
<v-layout justify-center align-center>
<v-flex shrink>
<div>your content</div>
</v-flex>
</v-layout>
</v-container>
i've been looking for 3 hours and cant find solution for my problem, dont know what am i doing wrong
All i want is to vertically align these 3 v-flex elements
<template>
<div class="home">
<v-container fluid class="pa-0">
<v-img :src="require('#/assets/images/background.jpg')" max-height="100%">
<v-layout align-center column>
<v-flex class="mb-2">
<span class="primary--text text-uppercase display-3 font-weight-thin">List</span>
<span class="white--text text-uppercase display-3 font-weight-thin">Series</span>
</v-flex>
<v-flex class="mb-4">
<h4 class="subheading grey--text">Follow the series you've been watching or are still watching!</h4>
</v-flex>
<v-flex>
<v-btn color="primary" depressed flat outline to="/add">
go to add
</v-btn>
</v-flex>
</v-layout>
</v-img>
</v-container>
</div>
</template>
One solution would be to move the image out of the container. Then use style="height: 100%;" align-center d-flex on container to make it fill image area and display contents vertically in the middle. Also you might want to consider image max-height="100vh" to prevent scrolling on smaller screens.
new Vue({
el: '#app'
})
<link href="https://cdn.jsdelivr.net/npm/vuetify#1.2.2/dist/vuetify.min.css" rel="stylesheet" />
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vuetify#1.2.2/dist/vuetify.min.js"></script>
<div id="app">
<template>
<div class="home">
<v-img src="https://images.unsplash.com/photo-1562696482-77619dec0ae7?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1351&q=80" max-height="100%">
<v-container style="height: 100%;" align-center d-flex fluid class="pa-0">
<v-layout align-center column>
<v-flex class="mb-2">
<span class="primary--text text-uppercase display-3 font-weight-thin">List</span>
<span class="white--text text-uppercase display-3 font-weight-thin">Series</span>
</v-flex>
<v-flex class="mb-4">
<h4 class="subheading grey--text">Follow the series you've been watching or are still watching!</h4>
</v-flex>
<v-flex>
<v-btn color="primary" depressed flat outline to="/add">
go to add
</v-btn>
</v-flex>
</v-layout>
</v-img>
</v-container>
</div>
</template>
</div>
I am using Vue/Vuetify and need to add text to carousel slides for descriptions. I think placing the text above the delimiters and below the image is the best place for it. I'd rather not overlay the text on the image. Vuetify documentation doesn't give any examples for this. How can this be done?
You can make own carousel design inside of v-carousel-item tags, using vuetify elements to place text where you want. Example on cedepen
<div id="app">
<v-app id="inspire">
<v-container fluid>
<v-layout row wrap justify-center>
<v-flex xs6>
<v-carousel hide-delimiters>
<v-carousel-item
v-for="(item,i) in items"
:key="i"
>
<v-img
:src="item.src"
class="fill-height"
>
<v-container
fill-height
fluid
pa-0 ma-0
>
<v-layout fill-height align-end>
<v-flex xs12>
<v-card color="red" class="pa-2" >
<span class="headline white--text" v-text="item.src"> </span>
</v-card>
</v-flex>
</v-layout>
</v-container>
</v-img>
</v-carousel-item>
</v-carousel>
</v-flex>
</v-layout>
</v-container>
</v-app>
</div>
Updated
<div id="app">
<v-app id="inspire">
<v-container fluid>
<v-layout row wrap justify-center>
<v-flex xs6>
<v-carousel>
<v-carousel-item
v-for="(item,i) in items"
:key="i"
:src="item.src"
>
<v-container
fill-height
fluid
pa-0 ma-0 pb-3
>
<v-layout fill-height align-end pb-4 mb-4>
<v-flex xs12>
<v-card color="red" class="pa-2">
<span class="headline white--text" v-text="item.src"> </span>
</v-card>
</v-flex>
</v-layout>
</v-container>
</v-carousel-item>
</v-carousel>
</v-flex>
</v-layout>
</v-container>
</v-app>
</div>
My v-flex it is not respecting my orders and only half of element it was rendered. see the print:
Print from my view
Here is my script:
<v-card-title primary-title>
<div>
<p class="subheading grey--text">My title</p>
<h3 class="headline my-4">my sub title</h3>
<div>
<v-container fluid>
<v-card flat v-for="ticket in tickets" :key="ticket.id">
<v-layout row wrap :class="`pa-2 ticket ${ticket.status.id}`">
<v-flex xs3>
<div class="caption grey--text">#ID</div>
<div>{{ticket.id}}</div>
</v-flex>
<v-flex xs3>
<div class="caption grey--text">Assunto</div>
<div>{{ticket.subject}}</div>
</v-flex>
<v-flex xs3>
<div class="caption grey--text">Criado em</div>
<div>{{ticket.created_on}}</div>
</v-flex>
<v-flex xs3>
<div class="right">
<v-chip
small
:class="`${ticket.status.id} white--text caption my-2`"
>{{ticket.status.name}}</v-chip>
</div>
</v-flex>
</v-layout>
</v-card>
</v-container>
</div>
</div>
</v-card-title>
Someone has any ideas?
Tks.
You can add a full width flex box above the v-card on line 7:
<v-flex xs12>
<v-card flat v-for="ticket in tickets" :key="ticket.id">
...
EDIT: My mistake... after taking another look you can change the div on line 2 to a v-flex, which will give you the results like in this codepen: https://codepen.io/retrograde/pen/ZNYJRq?editors=0001 Note that I removed the code added by my original answer.