Skip to content

Commit 0949c2a

Browse files
authored
Merge pull request #3 from formly-js/2.0
Updated Readme
2 parents 007c592 + bd1806d commit 0949c2a

File tree

1 file changed

+23
-17
lines changed

1 file changed

+23
-17
lines changed

README.md

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Vue Formly
22

3-
Vue Formly is a JS based form builder heavily inspired by [Angular Formly](http://angular-formly.com/). Vue Formly was designed to provide an easy way to keep your forms consistent and to remove bloat from your code. As there's no "one way" to design your forms, Vue Formly allows you to create custom input types which you can use in your form schemas. Vue Formly itself does not come with any inputs pre-loaded but a set of Bootsrap form inputs can be installed over at [Vue Formly Bootstrap](https://github.com/matt-sanders/vue-formly-bootstrap).
3+
Vue Formly is a JS based form builder heavily inspired by [Angular Formly](http://angular-formly.com/). Vue Formly was designed to provide an easy way to keep your forms consistent and to remove bloat from your code. As there's no "one way" to design your forms, Vue Formly allows you to create custom input types which you can use in your form schemas. Vue Formly itself does not come with any inputs pre-loaded but a set of Bootsrap form inputs can be installed over at [Vue Formly Bootstrap](https://github.com/formly-js/vue-formly-bootstrap).
44

55
*NOTE*
6-
Not currently compatible with Vue 2.0. But it's on the list...
6+
This is version 2 of Vue Formly and is only compatible with Vue 2.x. If you are wanting to use this with Vue 1.x then check out the [Vue Formly 1 Branch](https://github.com/formly-js/vue-formly/tree/1.0).
77

88
## Installation
99
```
@@ -14,11 +14,11 @@ Or via a script
1414
<script src="your_dir/vue-formly/vue-formly.min.js"></script>
1515
```
1616
## Usage
17-
Take a look at the [docs](https://www.gitbook.com/book/matt-sanders/vue-formly/details) for extended information about using Formly and creating custom input types. But here is a quick example:
17+
Take a look at the [docs](https://www.gitbook.com/book/matt-sanders/vue-formly/content/v/2.0/) for extended information about using Formly and creating custom input types. But here is a quick example:
1818
```html
1919
<div id="app">
2020
<form @submit="handleSubmission">
21-
<formly-form :form="form"></formly-form>
21+
<formly-form :form="form" :model="model" :fields="fields"></formly-form>
2222
<button>Submit</button>
2323
</form>
2424
</div>
@@ -27,34 +27,40 @@ Take a look at the [docs](https://www.gitbook.com/book/matt-sanders/vue-formly/d
2727
new Vue({
2828
el: '#app',
2929
data: {
30-
form: {
31-
name: {
30+
model: {
31+
name: '',
32+
email: '',
33+
password: ''
34+
},
35+
form: [
36+
{
37+
key: 'name',
3238
type: 'input',
3339
required: true
3440
},
35-
email: {
41+
{
42+
key: 'email',
3643
type: 'input',
37-
inputType: 'email',
44+
templateOptions: {
45+
type: 'email'
46+
},
3847
required: true,
3948
validators: {
4049
validEmail: checkEmailFunction
4150
}
4251
},
43-
password: {
52+
{
53+
key: 'password',
4454
type: 'input',
45-
inputType: 'password',
55+
templateOptions: {
56+
type: 'password'
57+
},
4658
required: true,
4759
validators: {
4860
validPassword: checkPasswordFunction
4961
}
5062
}
51-
}
63+
]
5264
}
5365
});
5466
```
55-
56-
## To Do
57-
* [x] Implement validation
58-
* [x] Better error handling
59-
* [x] Simplified data access
60-
* [ ] Implement Vue 2.0 compatibility

0 commit comments

Comments
 (0)