Skip to content

Commit 3d7c3a4

Browse files
committed
Update README.md
1 parent 00999d2 commit 3d7c3a4

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

README.md

+26-1
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,41 @@ https://github.com/icebob/vue-form-generator/archive/master.zip
3636
```
3737

3838
## Usage
39-
Simply require it and add as a component:
39+
```html
40+
<template>
41+
<div class="panel-body">
42+
<vue-form-generator :schema="schema" :model="model" :options="formOptions"></vue-form-generator>
43+
</div>
44+
</template>
45+
46+
```
4047
```js
48+
<script>
4149
import VueFormGenerator from "vue-form-generator";
4250

4351
export default {
4452
...
4553
components: {
4654
VueFormGenerator: VueFormGenerator.component
55+
},
56+
57+
data: {
58+
schema: { ... },
59+
model:
60+
id: 1,
61+
name: "John Doe",
62+
password: "J0hnD03!x4",
63+
skills: ["Javascript", "VueJS"],
64+
65+
status: true
66+
},
67+
formOptions: {
68+
validateAfterLoad: true,
69+
validateAfterChanged: true
70+
}
4771
}
4872
...
73+
</script>
4974
```
5075

5176
## Examples

0 commit comments

Comments
 (0)