I'm trying that the lower right component will fill all its space,
I've placed a div element but for some reason, it won't fill out the whole width
I want it to fill everything from the sidebar to the end (also full height).
I don't want to use CSS positioning for this.
I tried width: 100% but it doesn't work
code:
<template>
<div>
<v-navigation-drawer v-model="drawer" clipped fixed app>
<v-list dense>
<v-list-tile class="mt-3" #click>
<v-list-tile-action>
<v-icon color="darken-1">add_circle_outline</v-icon>
</v-list-tile-action>
<v-list-tile-title>Subscribe</v-list-tile-title>
</v-list-tile>
<v-list-tile disabled #click>
<v-list-tile-action>
<v-icon>dashboard</v-icon>
</v-list-tile-action>
<v-list-tile-content>
<v-list-tile-title>Dashboard</v-list-tile-title>
</v-list-tile-content>
</v-list-tile>
<v-list-tile disabled #click>
<v-list-tile-action>
<v-icon>settings</v-icon>
</v-list-tile-action>
<v-list-tile-content>
<v-list-tile-title>Settings</v-list-tile-title>
</v-list-tile-content>
</v-list-tile>
</v-list>
</v-navigation-drawer>
<v-toolbar app fixed clipped-left>
<v-toolbar-side-icon #click.stop="drawer = !drawer"></v-toolbar-side-icon>
<v-toolbar-title>Application</v-toolbar-title>
</v-toolbar>
<div class="editor" style="border: 1px solid red; width: 100%;">
<v-flex xs12 sm6 md3>
<v-text-field
readonly
label="Regular"
placeholder="Placeholder"
></v-text-field>
</v-flex>
</div>
<v-footer app fixed>
<span>© 2017</span>
</v-footer>
</div>
</template>
<script>
export default {
data: () => ({
drawer: null
}),
props: {
source: String
}
};
</script>
You are missing the v-content. You need to replace your
<div class="editor" style="border: 1px solid red; width: 100%;">
<v-flex xs12 sm6 md3>
<v-text-field
readonly
label="Regular"
placeholder="Placeholder"
></v-text-field>
</v-flex>
</div>
with:
<v-content>
<v-container fluid style="border: 1px solid red;">
<v-text-field
readonly
label="Regular"
placeholder="Placeholder"
></v-text-field>
</v-container>
</v-content>
You can read more about it Here.
And as you add more elements to your v-container it will expand in height.
If you add fill-height to v-container, it will take the whole height.
Related
Have an interesting case where when I hover over a v-list-item in my application, all the items in the v-list's background are changing to a different shade. It is a global application issue as it happens in all areas of my application.
I've inspected other v-list items that are behaving as expected and I don't see any styles that are missing.
Ideally, I'd like my v-list to behave as expected and shade only the one v-list item as it normally does but just do not know where to begin my search.
Any help would be appreciated.
<template>
<v-card elevation="0">
<v-card-text>
<v-row>
<v-col cols="12" class="d-flex gap align-center my-0 py-0">
<v-menu offset-y>
<template v-slot:activator="{ on, attrs }">
<v-btn v-bind="attrs" v-on="on" icon>
<v-icon>
{{ mdiDotsVertical }}
</v-icon>
</v-btn>
</template>
<v-list class="py-0 my-0">
<v-list-item #click="showAdvancedEditDialog = true">
<v-icon class="mr-2" color="primary">
{{ mdiPencil }}
</v-icon>
<div color="primary" class="overflowText">
Advanced
</div>
</v-list-item>
<v-list-item #click="showHtmlEditDialog = true">
<v-icon class="mr-2" color="primary">
{{ mdiCodeTags }}
</v-icon>
<div color="primary" class="overflowText">
HTML Edit
</div>
</v-list-item>
</v-list>
</v-menu>
</v-col>
</v-row>
</v-card-text>
</v-card>
</template>
<style>
.overflowText {
font-size: 14px;
font-family: Roboto;
text-transform: uppercase;
font-weight: 500;
color: #f2545b;
}
</style>
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>
My toolbar and sidenav sit on top of my container obstructing view of the contents.
I can easily put a top margin on the container to rectify the issue with the toolbar but because the sidenav retracts when screen width is reduced trying to do the same with the sidenav results in display issues.
App.vue
<template>
<v-app>
<Navs/>
<div class="div" style="margin-top: 64px;">
<router-view/>
</div>
<Footer/>
</v-app>
</template>
Navs.vue
<template>
<div class="content">
<!-- Sidenav draw -->
<v-navigation-drawer
class = "NavDark"
persistent
:mini-variant="true"
:clipped="clipped"
v-model="drawer"
enable-resize-watcher
mobile-break-point="1000"
app
>
<v-layout align-center justify-space-between fill-height column>
<v-layout align-center justify-start fill-height column>
<!-- Logo square -->
<div style = "height: 64px; width: 82px; position: absolute; z-index: -1;">
<Granim/>
</div>
<div style = "height: 64px;">
<v-container pa-0 bg fill-height grid-list-md text-xs-center>
<v-layout row wrap align-center>
<v-flex pa-0>
<v-list-tile-avatar>
<img src="#/assets/layout/sidebar/whitelogo.png" class="logo">
</v-list-tile-avatar>
</v-flex>
</v-layout>
</v-container>
</div>
<!-- </v-toolbar> -->
<!-- Items at the top of the sidenav -->
<v-list dark>
<v-list-tile
v-for="item in topMenuItems"
:key="item.title"
:to="item.path"
style="padding: 10px, 0px, 10px , 0px"
>
<v-tooltip right>
<v-list-tile-action
slot="activator"
>
<v-icon>{{ item.icon }}</v-icon>
</v-list-tile-action>
<v-list-tile-content>{{ item.title }}</v-list-tile-content>
</v-tooltip>
</v-list-tile>
</v-list>
</v-layout>
<v-list dark>
<!-- </v-layout> -->
<v-layout align-center justify-end column fill-height>
<v-menu
v-model="menu"
:close-on-content-click="false"
:nudge-width="200"
offset-x
>
<v-btn
slot="activator"
dark
icon
>
<v-icon>person</v-icon>
</v-btn>
<v-card>
<v-list>
<v-list-tile>
<v-list-tile-content>
<v-list-tile-title>{{ user.email }}</v-list-tile-title>
<v-list-tile-sub-title>{{ user.token }}</v-list-tile-sub-title>
</v-list-tile-content>
</v-list-tile>
</v-list>
<v-divider></v-divider>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn flat #click="menu = false">Cancel</v-btn>
<v-btn color="primary" flat #click="menu = false">Settings</v-btn>
<v-btn color="error" flat #click="userSignOut">Logout</v-btn>
</v-card-actions>
</v-card>
</v-menu>
</v-layout>
</v-list>
</v-layout>
</v-navigation-drawer>
<v-toolbar
app
class ="elevation-0"
color="#eee"
:clipped-left="clipped"
>
<v-toolbar-side-icon
class="hidden-md-and-up"
#click="drawer = !drawer">
</v-toolbar-side-icon>
<v-toolbar-title v-text="title" class="toolbar-text"></v-toolbar-title>
<v-spacer></v-spacer>
<v-toolbar-title v-if="user" v-text="user.email" class="toolbar-text"></v-toolbar-title>
</v-toolbar>
</div>
</template>
<style>
.NavDark {
height: 100vh;
box-shadow: 0 16px 38px -12px rgba(0,0,0,.56), 0 4px 25px 0 rgba(0,0,0,.12), 0 8px 10px -5px rgba(0,0,0,.2);
}
</style>
Ideally I'm trying to find a solution in which the <router-view/> will not overlap with <Navs/> and fill all available space on the screen not taken by the toolbar and sidenav.
Resolved by using v-content
<template>
<v-app>
<Navs/>
<v-content class="light">
<router-view/>
</v-content>
<Footer/>
</v-app>
</template>
this my code :
<v-container grid-list-md fluid-fix>
<div v-for="(data ,c) in chapter.data" :key="c" class="my-3" style="border: 1px solid;">
<v-layout row wrap px-3>
<v-flex xs12 sm1>
<v-text-field v-model="data.num" label="Chapter"></v-text-field>
</v-flex>
<v-flex xs12 sm3>
<v-text-field v-model="data.name" label="name"></v-text-field>
</v-flex>
<v-flex xs12 sm8 d-flex>
<v-text-field v-model="data.description" label="short info" style="width: 100%;"></v-text-field>
<div>
<v-btn class="d-inline-flex servers--btn" color="success" #click="addServer(c)">add server</v-btn>
</div>
</v-flex>
</v-layout>
<v-container grid-list-md fluid-fix>
<v-layout wrap v-for="(server ,s) in data.servers" :key="s">
<v-flex sm12>
<div class="d-inline-flex">
<v-autocomplete
:items="data.serverlist"
v-model="server.server_id"
#input="serverChange(data)"
label="Server"
></v-autocomplete>
</div>
<div class="d-inline-flex text-xs-right pr-1">
<v-btn color="orange" class="white--text servers--btn" #click="demo_edit(c,s,server.links)">demo and Edit</v-btn>
</div>
<div class="d-inline-flex text-xs-right pr-1" style="float: right;">
<v-btn color="red" class="white--text servers--btn" #click="delSvOnChap(c,s)">Delete Server</v-btn>
</div>
</v-flex>
<v-flex sm12>
<v-textarea
v-model="server.links"
label="box image"
></v-textarea>
</v-flex>
</v-layout>
</v-container>
serverChange(data){
data.serverlist.forEach(obj => {
if(_.find(data.servers,{server_id: obj.value})){
obj.disabled = true
}else{
obj.disabled = false
}
});
},
serverChange is in methods
i want update disabled in the key has been determined , but it's update all object in array
when I log serverChange function i just see one object return and that's what I'm looking forward to but when i set disabled for this object , vue update all object in array
I need a solution for this problem .
While making list screen with v-list.
I stuck scrolling v-list-title items.
I'm using VueJS and vuetifyjs.
My code snip is at below.
https://codepen.io/badsaarow/pen/aaRaxe?editors=1010
My aim is that toolbar area is fixed, and only v-list-titles are scrollable.
<div id="app">
<v-app id="inspire">
<v-container fluid grid-list-lg>
<v-layout row wrap>
<v-flex xs12 sm12 md6>
<v-card>
<v-toolbar color="light-blue" light extended>
<v-btn
fab
small
color="cyan accent-2"
bottom
right
absolute
#click="dialog = !dialog"
>
<v-icon>add</v-icon>
</v-btn>
<v-toolbar-title slot="extension" class="white--text">user list</v-toolbar-title>
<v-spacer></v-spacer>
</v-toolbar>
<v-list two-line>
<v-list-tile
v-for="user in users"
avatar
#click=""
>
<v-list-tile-avatar>
<v-icon :class="iconClass">face</v-icon>
</v-list-tile-avatar>
<v-list-tile-content>
<v-list-tile-title>{{ user.lastName }}{{ user.firstName }}</v-list-tile-title>
<v-list-tile-sub-title>{{ user.name }}</v-list-tile-sub-title>
</v-list-tile-content>
<v-list-tile-action>
<v-btn icon ripple>
<v-icon color="grey lighten-1">info</v-icon>
</v-btn>
</v-list-tile-action>
</v-list-tile>
</v-list>
</v-card>
</v-flex>
</v-layout>
</v-container>
</v-app>
</div>
Try to add following CSS to make v-list-titles scrollable.
.v-list {
height: 300px;
overflow-y: auto;
}
We need to specify a fixed height for our DOM object, and once we set the overflow-y attribute as auto. A scroll bar will show up once content has bigger length than parent.
Here is the modified version, have a try.
Just add the fixed prop to v-toolbar, as so:
<v-toolbar color="light-blue" light extended fixed>
See here for updated pen