我正在嘗試將我的身份驗證組件(v-card)水平和垂直居中。我嘗試了各種解決方案,例如justify=center行align=center,v-container 上的 fill-height,v-container 但它不起作用。我在這里做錯了什么?
代碼 :
<script setup lang="ts">
import { useUserStore } from "../../stores/user";
const store = useUserStore();
</script>
<template>
<v-card width="800" >
<v-card-title>
Authentication
</v-card-title>
<v-card-subtitle>
login with username and password
</v-card-subtitle>
<v-card-text>
<v-row>
<v-col cols="12" md="6">
<v-text-field v-model="store.username" label="Username"></v-text-field>
</v-col>
<v-col cols="12" md="6">
<v-text-field v-model="store.password" label="Password"></v-text-field>
</v-col>
</v-row>
</v-card-text>
</v-card>
</template>
<script setup lang="ts">
import Auth from "../components/auth/Auth.component.vue"
</script>
<template>
<v-container>
<v-row style="border:1px solid red;" fill-height>
<v-col >
<Auth/>
</v-col>
</v-row>
</v-container>
</template>
<template>
<v-app>
<v-main>
<router-view></router-view>
</v-main>
</v-app>
</template>
<script setup lang="ts">
</script>
uj5u.com熱心網友回復:
更新
檢查我制作的這個代碼框:
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/444698.html
標籤:Vue.js Vuetify.js
上一篇:將布林值傳遞給v-for回圈
