formily
A Simple, lightweight, and flexible schema-based form for Vue.js
Features
? Flexible: Easily to handle from basic to nested forms, group of forms...
⚙️ Dynamically: Generate form components dynamically.
? Schema: Build faster form by schema.
? Lightweight: Small built size. Gzip: ~5 KB
✅ Validation: Validate form elements with built-in Rules that covers most needs in most web applications
? Plugins: Extend functionally by third-party plugins or your own plugins.
? Extensibility: Easily to make your own custom form element by extending the core elements.
Links
Installation
CDN
You can use vue-formily with a script tag and a CDN, import the library like this:
This will inject a VueFormily
global object, which you will use to access the various components, funtions exposed by vue-formily.
If you are using native ES Modules, there is also an ES Modules compatible build:
NPM
Set Up
Vue 3.x
Vue 2.x
Vue Version Support
The main v2 version supports Vue 3.x only, for previous versions of Vue, check the following the table
Vue Version | vue-formily version |
---|---|
2.x |
1.x |
3.x |
2.x |
Basic Usage
Let's start with a simple login form:
Defining Form Schema
vue-formily
need a form schema to work with, so let's define one:
Create New Form
Then we call $formily.add
to create new form element and injects it to Vue instance's forms
object.
Here is the live demo.
License
[MIT]