- Fixed
transformRequest
when provided.
- Added support for AxiosResponse type.
- Added
recentlySuccessful
property toForm
#130.
- Fixed package.json exports.
- Handle files with
FormData
by default. - Added upload
progress
property toForm
.
- Fixed missing
Method
type for old axios versions.
- Fixed package.json exports.
- New site vform.vercel.app!
- Added support for Vue 3.
- Added support for TypeScript.
- Added new
Button
component. - Added Boostrap 5 and Tailwind CSS components.
- Added
Form.prototype.update
. - Fixed params for GET requests.
- Dropped support for Boostrap 3 components.
- The components are no longer bundled. Replace
import { HasError } from 'vform'
withimport { HasError } from 'vform/src/components/bootstrap5'
.
- Added
Form.axios
to allow using a custom axios instance (Form.axios = customAxiosInstance
).
- Removed file detection, instead use axios's
transformRequest
option and object-to-formdata. See example/upload.html. Errors.set
now accepts a specified error message:Errors.set(field, message)
.- Added default slot to the
alert-error
component. - Update vue-cli, eslint, tests and examples.
- Added default slot to the
alert-success
component.
- Added
Form.prototype.onKeydown
.
- Merged Bootstrap component
HasError4
intoHasError
. - Added
Errors.prototype.getAll(field)
to get all the errors for a field.
- Fixed error message when response is not JSON.
- Added
Form.prototype.delete()
- Added
Form.prototype.keys()
to get the form data keys.
- Check for a response before extracting errors.
- Require
axios
as peer dependency.
- Add
name
to components. - Rename lib window name from
vForm
tovform
.
- Removed support as a Vue plugin;
vform
now exports theForm
class as default. - Dropped support for vue-resoure, axios is now used by default.
- Renamed
Form.prototype.send()
toForm.prototype.submit()
. - Renamed
Form.prototype.getData()
toForm.prototype.data()
. - Renamed class
FormErrors
toErrors
. - Renamed
Errors.prototype.hasErrors()
toErrors.prototype.any()
- Removed
Errors.prototype.remove(field)
in favor ofErrors.prototype.clear(field)
. - Added tests.
- Changed how
Form.prototype.reset()
works. The form keeps now a copy of the original data. - Removed
mergeData
arg (new Form(data = {}, mergeData = {})
).
- Added support for axios.
- An http client must now be set via the
http
option. Supported: axios or vue-resoure. - The
components
option is set totrue
by default. - Added
FormErrors.prototype.remove(String field)
to remove the errors for the given field. - Removed
Form.routes()
method.
- Added
Form.prototype.set(Object data)
to set mutiple form fields
- Fixed
FormErrors.flatten
when there are no errors FormErrors.hasAny
can be called without any args to check if any errors exist
- Removed
Form.baseUrl
- Removed call to
Form.clear()
inForm.reset()
- To register the alert components use
Use Vue.use(vForm, {components: true})
.