我目前正在制作网站的登录页面,但无法正确地将我的 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)
但这样一来,文本线程就被压缩了,我无法放大它。在此先感谢您的帮助。
简洁且适用于 v2+。这将为您提供一张内容水平和垂直居中的 v 卡:
<v-card class="d-flex align-center justify-center" min-height="250">
Content here...
</v-card>
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
8763 次 |
最近记录: |