Allow multiple forms per plugin

This commit is contained in:
Joel Collins 2019-06-14 16:10:28 +01:00
parent 0fad5304f8
commit ff0fe49976

View file

@ -29,7 +29,7 @@
</tabContent> </tabContent>
<tabContent v-for="plugin in plugins" :key="plugin.id" :id="plugin.id" :requireConnection="plugin.requiresConnection" :currentTab="currentTab"> <tabContent v-for="plugin in plugins" :key="plugin.id" :id="plugin.id" :requireConnection="plugin.requiresConnection" :currentTab="currentTab">
<JsonForm :schema="plugin.schema"/> <JsonForm v-for="form in plugin.forms" :key="form.route" :route="form.route" :schema="form.schema"/>
</tabContent> </tabContent>
</div> </div>
@ -79,6 +79,9 @@ export default {
id: 'test-plugin', id: 'test-plugin',
icon: 'code', icon: 'code',
requireConnection: false, requireConnection: false,
forms: [
{
route: "/test/foo",
schema: [ schema: [
{ {
fieldType: "htmlBlock", fieldType: "htmlBlock",
@ -96,8 +99,7 @@ export default {
fieldType: "textInput", fieldType: "textInput",
placeholder: "Name", placeholder: "Name",
label: "Name", label: "Name",
name: "name", name: "name"
value: "Squidward"
}, },
{ {
fieldType: "numberInput", fieldType: "numberInput",
@ -124,19 +126,20 @@ export default {
fieldType: "radioList", fieldType: "radioList",
name: "coolness", name: "coolness",
label: "Coolness", label: "Coolness",
options: ["None", "Some", "Very"], options: ["None", "Some", "Very"]
value: "Some"
}, },
{ {
fieldType: "checkList", fieldType: "checkList",
name: "ingredients", name: "ingredients",
label: "Ingredients", label: "Ingredients",
options: ["Pork", "Pie"], options: ["Pork", "Pie"]
value: ["Pork"]
}, },
] ]
} }
] ]
}
]
} }
}, },