remove base-input from ForgotPasswort.vue

This commit is contained in:
ogerly 2021-06-12 08:47:42 +02:00
parent c60d3b68b9
commit 9d00b96c5f
2 changed files with 39 additions and 29 deletions

View File

@ -17,19 +17,31 @@
<b-col lg="6" md="8">
<b-card no-body class="border-0" style="background-color: #ebebeba3 !important">
<b-card-body class="p-4">
<validation-observer v-slot="{ handleSubmit }" ref="formValidator">
<validation-observer ref="observer" v-slot="{ handleSubmit }">
<b-form role="form" @submit.prevent="handleSubmit(onSubmit)">
<base-input
alternative
class="mb-3"
prepend-icon="ni ni-email-83"
:placeholder="$t('form.email')"
<validation-provider
name="Email"
:rules="{ required: true, email: true }"
v-model="form.email"
></base-input>
v-slot="validationContext"
>
<b-form-group class="mb-3" label="Email" label-for="input-reset-pwd">
<b-form-input
id="input-reset-pwd"
name="input-reset-pwd"
v-model="form.email"
placeholder="Email"
:state="getValidationState(validationContext)"
aria-describedby="reset-pwd--live-feedback"
></b-form-input>
<b-form-invalid-feedback id="reset-pwd--live-feedback">
{{ validationContext.errors[0] }}
</b-form-invalid-feedback>
</b-form-group>
</validation-provider>
<div class="text-center">
<b-button type="submit" outline variant="secondary" class="mt-4">
<b-button type="submit" variant="primary">
{{ $t('site.password.reset_now') }}
</b-button>
</div>
@ -59,6 +71,9 @@ export default {
}
},
methods: {
getValidationState({ dirty, validated, valid = null }) {
return dirty || validated ? valid : null
},
async onSubmit() {
const result = await loginAPI.sendEmail(this.form.email)
if (result.success) {

View File

@ -30,22 +30,17 @@
:rules="{ required: true, email: true }"
v-slot="validationContext"
>
<b-form-group
class="mb-3"
id="example-input-group-1"
label="Email"
label-for="example-input-1"
>
<b-form-group class="mb-3" label="Email" label-for="input-login-email">
<b-form-input
id="example-input-1"
id="input-login-email"
name="example-input-1"
v-model="model.email"
placeholder="Email"
:state="getValidationState(validationContext)"
aria-describedby="input-1-live-feedback"
aria-describedby="login-email-live-feedback"
></b-form-input>
<b-form-invalid-feedback id="input-1-live-feedback">
<b-form-invalid-feedback id="login-email-live-feedback">
{{ validationContext.errors[0] }}
</b-form-invalid-feedback>
</b-form-group>
@ -97,7 +92,7 @@
</span>
</b-alert>
<div class="text-center">
<b-button class="ml-2" @click="resetForm()">{{ $t('form.reset') }}</b-button>
<!--<b-button class="ml-2" @click="resetForm()">{{ $t('form.reset') }}</b-button>-->
<b-button type="submit" variant="primary">{{ $t('login') }}</b-button>
</div>
</b-form>
@ -143,16 +138,16 @@ export default {
getValidationState({ dirty, validated, valid = null }) {
return dirty || validated ? valid : null
},
resetForm() {
this.model = {
email: null,
password: null,
}
this.$nextTick(() => {
this.$refs.observer.reset()
})
},
//resetForm() {
// this.model = {
// email: null,
// password: null,
// }
//
// this.$nextTick(() => {
// this.$refs.observer.reset()
// })
//},
togglePasswordVisibility() {
this.passwordVisible = !this.passwordVisible