Skip to content

Commit 966d5b0

Browse files
committed
Update example
1 parent f2ebf68 commit 966d5b0

File tree

1 file changed

+27
-5
lines changed

1 file changed

+27
-5
lines changed

docs/api/ui-schema.md

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,36 @@
22

33
An array of [fields](ui-schema/field.md).
44

5+
## Example
6+
57
```js
68
data() {
79
return {
8-
uiSchema: [{
9-
component: 'div'
10-
}, {
11-
component: MyCustomComponent,
12-
}]
10+
uiSchema: [
11+
{
12+
component: 'div',
13+
fieldOptions: {
14+
class: ['form-group']
15+
},
16+
children: [
17+
{
18+
component: 'input',
19+
model: 'firstName',
20+
fieldOptions: {
21+
on: ['input']
22+
}
23+
}
24+
]
25+
}
26+
]
1327
}
1428
}
1529
```
30+
31+
The example above will do essentially the same thing as the following Vue template:
32+
33+
```html
34+
<div class="form-group">
35+
<input v-model="model.firstName" />
36+
</div>
37+
```

0 commit comments

Comments
 (0)