crickford / vue-json-schema-form

VueJS library for generating forms from JSON schemas

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Custom component in nested object

jafda opened this issue · comments

commented

@crickford Using the advance demo, i am trying to use the rating component in a nested object. The default input box shows instead of the rating component. It appears only root object items are supported, any thoughts to nested obects?

Looks like it the code processing custom component is SchemaForm.vue:
<template v-for="(property, key) in schema.properties"> <slot :name="key" :item="{key: key, schema: property, value: items[key], update: updateValue}"> <component :is="element" :key="key" :schema="property" :value="items[key]" @input="updateValue($event, key)"></component> </slot> </template>

Schema Example:
{ "type": "object", "properties": { "test": { "type": "object", "properties" : { "teststring": { "type": "string", "title": "Test String" }, "rating": { "type": "number", "title": "Rating", "minimum": 0, "maximum": 5 } } } } }

Might need to do something like this.