You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a powerful tool and works great with the options API. However, I try using vForm with vue3 composition API. Although the backend returns validation errors, the form errors still appear blank.
<template>
<form @submit.prevent="updatePassword()" @keydown="passwordForm.onKeydown($event)">
<div class="mb-2">
<Label> Current Password </Label>
<input type="password" v-model="passwordForm.current_password" class="form-control">
<div v-if="passwordForm.errors.has('current_password')" v html="form.errors.get('current_password')" />
</div>
<div class="mb-2 mt-3 text-right">
<btn type="submit" :disabled="passwordForm.busy" class="btn btn-md btn-success"> <i class="fa fa-save"></i> Save Changes </btn>
</div>
</form>
</template>
<script setup>
import { reactive, } from 'vue';
import Form from 'vform'
import { HasError } from 'vform/src/components/bootstrap5'
let passwordForm = reactive(new Form({
current_password: '',
}))
const updatePassword = async() => {
axios.post('/api/user/update_password', passwordForm).then(res=> {
if(res.data.success){
}else{
}
})
}
</script>
On submission, nothing seems to happen to the form object. [HERE](https://ibb.co/YRtD2CG) is a screenshot after the form submission. I guess there is something I've not done rightly.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
This is a powerful tool and works great with the options API. However, I try using vForm with vue3 composition API. Although the backend returns validation errors, the form errors still appear blank.
Beta Was this translation helpful? Give feedback.
All reactions