You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With Vue one can use both locally and globally registered components. If not all the components you want to use are globally registered you can use the `components` property to pass in additional components to `vue-form-json-schema`.
4
+
5
+
## Provide locally registered components
6
+
7
+
In this example we re-use the locally registered components and pass them along to `vue-form-json-schema`
8
+
9
+
```html
10
+
<template>
11
+
<vue-form-json-schema
12
+
v-model="model"
13
+
:schema="schema"
14
+
:ui-schema="uiSchema"
15
+
:components="$options.components"
16
+
/>
17
+
</template>
18
+
19
+
<script>
20
+
importMyComponentfrom"./MyComponent"
21
+
22
+
exportdefault {
23
+
components: {
24
+
"my-component": MyComponent
25
+
},
26
+
data() {
27
+
return {
28
+
model: {
29
+
firstName:"John",
30
+
},
31
+
schema: {
32
+
type:'object',
33
+
properties: {
34
+
firstName:'string'
35
+
}
36
+
},
37
+
uiSchema: [{
38
+
component:"my-component",
39
+
model:'firstName',
40
+
fieldOptions: {
41
+
on: ['input']
42
+
}
43
+
}]
44
+
}
45
+
}
46
+
}
47
+
</script>
48
+
```
49
+
50
+
## Use components directly without registering them
51
+
52
+
In this example we pass the components along to `vue-form-json-schema` without registering them first
0 commit comments