Try to use tailwind

This commit is contained in:
2022-02-04 16:34:16 +00:00
parent f7dfc7b455
commit d825379a01
9 changed files with 78 additions and 136 deletions

View File

@ -6,7 +6,7 @@ import { defineComponent } from "vue";
export default defineComponent({
data() {
return {
error: [],
error: "",
login: {
user: "",
password: ""
@ -18,14 +18,14 @@ export default defineComponent({
this.$store.commit(TITLE, "Login");
},
methods: {
formSubmit(e) {
formSubmit(e : MouseEvent) {
e.preventDefault();
this.$store.dispatch(LOGIN, this.$data.login)
.then(x => {
this.$data.error = "";
this.$router.replace("/dashboard");
})
.catch(x => this.$data.error = ["The entered credentials are invalid!"]);
.catch(x => this.$data.error = "The entered credentials are invalid!");
// TODO display invalidCredentials
// TODO redirect to dashboard on success
@ -35,29 +35,14 @@ export default defineComponent({
</script>
<template>
<v-container>
<v-row>
<v-col cols="12">
<v-text-field v-model="login.user" type="text" label="Username" />
</v-col>
<v-col cols="12">
<v-text-field
v-model="login.password"
label="Password"
:append-icon="showPassword ? 'mdi-eye' : 'mdi-eye-off'"
:type="showPassword ? 'text' : 'password'"
@click:append="showPassword = showPassword"
:error-message="error"
error-count="2"
error
/>
</v-col>
</v-row>
<div class="form-group">{{ error }}</div>
<v-btn type="submit" @click="formSubmit">Login</v-btn>
<div>
<input type="text" v-model="login.user" label="Username" />
<input type="password" v-model="login.password" label="Password" />
</div>
<div>{{ error }}</div>
<button type="submit" @click="formSubmit">Login</button>
<p>
New user?
<router-link to="/register">Register</router-link>instead!
</p>
</v-container>
</template>