使用 vuetify 水平和垂直居中 v 卡的最佳方式

Tes*_*tas 2 vue.js vuetify.js

我目前正在制作网站的登录页面,但无法正确地将我的 v 卡水平和垂直居中。我得到的最好成绩是这个:

<template>
    <v-layout align-center justify-center column fill-height>
        <v-flex row align-center>
            <v-card>
                <v-toolbar color="primary" >
                    <v-toolbar-title>Login</v-toolbar-title>
                </v-toolbar>
                <v-text-field label="Email" v-model="email"/>
                <v-text-field label="Password" v-model="password" />
                <v-footer>
                    <div>
                        <v-btn color="primary" v-on:click="login()">Login</v-btn>
                        <p>I don't have account: <a>Register</a></p>
                    </div>
                </v-footer>
            </v-card>
        </v-flex>
    </v-layout>
</template>

<script>
export default {
    name: 'Login',
    data() {
        return {
            email: "",
            password: ""
        }
    },
    methods: {
        login() {
            console.log('login')
        }
    }
}
</script>
Run Code Online (Sandbox Code Playgroud)

但这样一来,文本线程就被压缩了,我无法放大它。在此先感谢您的帮助。

Ric*_*and 7

简洁且适用于 v2+。这将为您提供一张内容水平和垂直居中的 v 卡:

<v-card class="d-flex align-center justify-center"  min-height="250">
    Content here...
</v-card>
Run Code Online (Sandbox Code Playgroud)

代码笔