Skip to content

Commit eec6189

Browse files
committed
Fix uiSchema not always being an array in doc
1 parent 91345c1 commit eec6189

File tree

7 files changed

+25
-24
lines changed

7 files changed

+25
-24
lines changed

docs/api/ui-schema/field/field-options/attrs.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ Essentially any normal html attributes
66
// Normal HTML attributes
77
data() {
88
return {
9-
uiSchema: {
9+
uiSchema: [{
1010
component: 'div',
1111
fieldOptions: {
1212
attrs: {
1313
id: 'foo',
1414
placeholder: 'bar'
1515
}
1616
}
17-
}
17+
}]
1818
}
1919
}
2020
```

docs/api/ui-schema/field/field-options/class.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ An `Object` must have the classes as keys and the keys' value should be a `Boole
99
```js
1010
// Option 1: Object
1111
data() {
12-
uiSchema: {
12+
uiSchema: [{
1313
component: 'div',
1414
fieldOptions: {
1515
class: {
@@ -18,7 +18,7 @@ data() {
1818
'col-lg-4': false // Class is NOT included
1919
}
2020
}
21-
}
21+
}]
2222
}
2323
```
2424

@@ -29,7 +29,7 @@ An `Array` should be a an array of strings, multidimensional arrays or arrays wi
2929
```js
3030
// Option 2: Arrays
3131
data() {
32-
uiSchema: {
32+
uiSchema: [{
3333
component: 'div',
3434
fieldOptions: {
3535
// All values in array is included
@@ -38,7 +38,7 @@ data() {
3838
'col-md-6'
3939
]
4040
}
41-
}
41+
}]
4242
}
4343
```
4444

@@ -47,11 +47,11 @@ data() {
4747
```js
4848
// Option 3: String
4949
data() {
50-
uiSchema: {
50+
uiSchema: [{
5151
component: 'div',
5252
fieldOptions: {
5353
class: 'col-12 col-md-6'
5454
}
55-
}
55+
}]
5656
}
5757
```

docs/api/ui-schema/field/field-options/dom-props.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
// DOM properties
77
data() {
88
return {
9-
uiSchema: {
9+
uiSchema: [{
1010
component: 'div',
1111
fieldOptions: {
1212
domProps: {
1313
innerHTML: '<div style="background-color: red">Hello</div>'
1414
}
1515
}
16-
}
16+
}]
1717
}
1818
}
1919
```

docs/api/ui-schema/field/field-options/native-on.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ Accepts a `String`, `Array` or an `Object`.
99
// Option 1: String
1010
data() {
1111
return {
12-
uiSchema: {
12+
uiSchema: [{
1313
component: 'input',
1414
fieldOptions: {
1515
on: 'input'
1616
}
17-
}
17+
}]
1818
}
1919
}
2020
```
@@ -25,14 +25,14 @@ data() {
2525
// Option 2: Arrays
2626
data() {
2727
return {
28-
uiSchema: {
28+
uiSchema: [{
2929
component: 'input',
3030
fieldOptions: {
3131
nativeOn: [
3232
'input'
3333
]
3434
}
35-
}
35+
}]
3636
}
3737
}
3838
```
@@ -47,14 +47,14 @@ An `Object` can be used if the value should be manipulated or used elsewhere bef
4747
// Option 3: Object
4848
data() {
4949
return {
50-
uiSchema: {
50+
uiSchema: [{
5151
component: 'input',
5252
fieldOptions: {
5353
nativeOn: {
5454
'input': event => String(event.target.value).toLowerCase();
5555
}
5656
}
57-
}
57+
}]
5858
}
5959
}
6060
```

docs/api/ui-schema/field/field-options/on.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ Accepts a `String`, `Array` or an `Object`.
99
// Option 1: String
1010
data() {
1111
return {
12-
uiSchema: {
12+
uiSchema: [{
1313
component: 'input',
1414
fieldOptions: {
1515
on: 'input'
1616
}
17-
}
17+
}]
1818
}
1919
}
2020
```
@@ -25,14 +25,14 @@ data() {
2525
// Option 2: Arrays
2626
data() {
2727
return {
28-
uiSchema: {
28+
uiSchema: [{
2929
component: 'input',
3030
fieldOptions: {
3131
on: [
3232
'input'
3333
]
3434
}
35-
}
35+
}]
3636
}
3737
}
3838
```

docs/api/ui-schema/field/field-options/props.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ Vue.component('my-custom-component', {
1313
...
1414
data() {
1515
return {
16-
uiSchema: {
16+
uiSchema: [{
1717
component: 'my-custom-component',
1818
fieldOptions: {
1919
props: {
2020
message: 'Hello!'
2121
}
2222
}
23-
}
23+
}]
2424
}
2525
}
2626
```

docs/api/ui-schema/field/field-options/slot.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ MyCustomComponent.vue
1313
```
1414

1515
MyForm.vue
16+
1617
```html
1718

1819
...
@@ -21,7 +22,7 @@ MyForm.vue
2122
export default {
2223
data() {
2324
return {
24-
uiSchema: {
25+
uiSchema: [{
2526
component: 'my-custom-component' // globally registered component
2627
children: [{
2728
component: 'div',
@@ -32,7 +33,7 @@ export default {
3233
slot: 'main'
3334
}
3435
}]
35-
}
36+
}]
3637
}
3738
}
3839
}

0 commit comments

Comments
 (0)