Vue form components with server side validation in mind
FormVuelar is a set of predefined vue form components which are designed to automatically display errors coming back from your backend. It works out of the box with the error message bag that is returned by Laravel when submitting an ajax form.
Demo
Try the demo form!
Getting Started
npm install formvuelar --save
Styling
The styling is totally up to you. All components have their own classes so you have full controll over the look feel of every component.
Every component is wrapped with a div and the coresponding class .fvl-{type}-wrapper.
Labels have a class name of .fvl-{type}-label.
The field itself has a class name of .fvl-{type}
Example classes of the text input component (using Tailwind)
.fvl-input-wrapper {
@apply p-2;
}
.fvl-input-label {
@apply block uppercase tracking-wide text-grey-darker text-xs font-bold mb-2;
}
.fvl-input {
@apply appearance-none block w-full bg-grey-lighter text-grey-darkest border border-grey-lighter rounded py-3 px-4 leading-tight;
}
I'm using Tailwind CSS for the demo.
Feel free to use the predefined css component classes for your own projects.