Simplified login form
This commit is contained in:
@@ -1,13 +1,9 @@
|
||||
<template>
|
||||
<v-row class="fill-height pa-4" align="center">
|
||||
<v-col cols="12" class="pa-0">
|
||||
<v-row no-gutters justify="center">
|
||||
<v-card class="elevation-12" width="500">
|
||||
<v-toolbar color="primary">
|
||||
<v-toolbar-title class="white--text font-weight-bold"
|
||||
>Zaloguj się</v-toolbar-title
|
||||
>
|
||||
</v-toolbar>
|
||||
<v-row justify="center">
|
||||
<v-col cols="auto">
|
||||
<v-card flat outlined class="rounded-lg" width="500">
|
||||
<v-card-title class="primary white--text">Zaloguj się</v-card-title>
|
||||
<v-divider></v-divider>
|
||||
<v-form v-model="inputValidated" @submit.prevent="loginUser()">
|
||||
<v-card-text class="pb-0">
|
||||
<v-text-field
|
||||
@@ -36,31 +32,26 @@
|
||||
</v-card-text>
|
||||
<v-card-actions class="pt-0">
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn
|
||||
:disabled="!inputValidated"
|
||||
color="primary"
|
||||
type="submit"
|
||||
>
|
||||
<v-btn :disabled="!inputValidated" color="primary" type="submit">
|
||||
<span class="font-weight-bold">Zaloguj</span>
|
||||
<v-icon right>mdi-key</v-icon>
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</v-form>
|
||||
</v-card>
|
||||
</v-row>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</template>
|
||||
|
||||
<script lang='ts'>
|
||||
import Vue from 'vue';
|
||||
import { Component } from 'vue-property-decorator';
|
||||
import Vue from "vue";
|
||||
import { Component } from "vue-property-decorator";
|
||||
|
||||
@Component
|
||||
export default class Login extends Vue {
|
||||
private async loginUser() {
|
||||
if (this.$data.inputValidated) {
|
||||
this.$store.dispatch('loginUser', {
|
||||
this.$store.dispatch("loginUser", {
|
||||
email: this.$data.email,
|
||||
pass: this.$data.password,
|
||||
});
|
||||
@@ -70,13 +61,13 @@ export default class Login extends Vue {
|
||||
private data() {
|
||||
return {
|
||||
inputValidated: false,
|
||||
email: '',
|
||||
password: '',
|
||||
email: "",
|
||||
password: "",
|
||||
showPass: false,
|
||||
rules: {
|
||||
required: (value: string) => !!value || 'Pole wymagane',
|
||||
required: (value: string) => !!value || "Pole wymagane",
|
||||
counter: (value: string, num: number, end: string) =>
|
||||
value.length >= num || 'Minimum ' + num + ' znak' + end,
|
||||
value.length >= num || "Minimum " + num + " znak" + end,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user