Add Centered component

This commit is contained in:
Hubert Van De Walle 2020-04-13 19:46:54 +02:00
parent 1310649e29
commit 3e27d4fa86
3 changed files with 118 additions and 104 deletions

View File

@ -0,0 +1,13 @@
<template>
<div class="row d-flex justify-content-center">
<div class="mt-3 col-md-6">
<slot></slot>
</div>
</div>
</template>
<script>
export default {
name: "Centered"
}
</script>

View File

@ -1,6 +1,5 @@
<template> <template>
<div class="row d-flex justify-content-center"> <Centered>
<div class="mt-3 col-md-6">
<b-card header="Sign in"> <b-card header="Sign in">
<b-form @submit.prevent="signin"> <b-form @submit.prevent="signin">
@ -34,17 +33,19 @@
</b-alert> </b-alert>
</b-card> </b-card>
</div> </Centered>
</div>
</template> </template>
<script> <script>
import Api from '@/api' import Api from '@/api'
import {mapMutations} from "vuex"; import {mapMutations} from "vuex";
import Centered from '@/components/Centered'
export default { export default {
name: "SignupForm", name: "SignupForm",
components: {
Centered
},
data() { data() {
return { return {
form: { form: {

View File

@ -1,7 +1,5 @@
<template> <template>
<div> <Centered>
<div class="row d-flex justify-content-center">
<div class="mt-3 col-md-6">
<b-card header="Create an account"> <b-card header="Create an account">
<b-form @submit.prevent="handleSubmit"> <b-form @submit.prevent="handleSubmit">
<b-form-group <b-form-group
@ -70,18 +68,20 @@
<b-alert :show="error" variant="danger" dismissible class="mt-3"> <b-alert :show="error" variant="danger" dismissible class="mt-3">
An error occurred while attempting to create your account An error occurred while attempting to create your account
</b-alert> </b-alert>
</b-card> </b-card>
</div> </Centered>
</div>
</div>
</template> </template>
<script> <script>
import Api from '@/api' import Api from '@/api'
import Centered from '@/components/Centered'
export default { export default {
name: "SignupForm", name: "SignupForm",
components: {
Centered
},
data() { data() {
return { return {
form: { form: {