INIT commit
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
<script setup>
|
||||
import {ref} from "vue";
|
||||
import {useUserStore} from "stores/User";
|
||||
import {useRouter} from "vue-router";
|
||||
|
||||
const email = ref("");
|
||||
const password = ref("");
|
||||
|
||||
const router = useRouter();
|
||||
const logUser = () => {
|
||||
useUserStore().login({email: email.value, password: password.value}).then(() => {
|
||||
console.log("tu ok");
|
||||
router.push({name: "myFlights"});
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<q-page class="window-height window-width row justify-center">
|
||||
<q-card square style="width:95%; max-width: 450px; height:400px;" class="q-mt-lg">
|
||||
<q-card-section class="bg-accent">
|
||||
<h4 class="text-h5 q-my-md text-white">Login</h4>
|
||||
</q-card-section>
|
||||
<q-card-section>
|
||||
<q-form class="q-px-sm q-pt-xl" @submit.prevent="logUser()">
|
||||
<q-input square clearable v-model="email" type="email" label="Email">
|
||||
<template v-slot:prepend>
|
||||
<q-icon name="email"/>
|
||||
</template>
|
||||
</q-input>
|
||||
<q-input square clearable v-model="password" type="password" label="Password">
|
||||
<template v-slot:prepend>
|
||||
<q-icon name="lock"/>
|
||||
</template>
|
||||
</q-input>
|
||||
</q-form>
|
||||
</q-card-section>
|
||||
|
||||
<q-card-actions class="q-px-lg">
|
||||
<q-btn unelevated size="lg" class="full-width" label="Sign In" @click.prevent="logUser()"/>
|
||||
</q-card-actions>
|
||||
<q-card-section class="text-center q-pa-sm">
|
||||
<p class="text-grey-6">Forgot your password?</p>
|
||||
</q-card-section>
|
||||
</q-card>
|
||||
|
||||
</q-page>
|
||||
</template>
|
||||
Reference in New Issue
Block a user