Skip to content

Latest commit

 

History

History
48 lines (40 loc) · 1.14 KB

groups.md

File metadata and controls

48 lines (40 loc) · 1.14 KB

Groups

A group in the schema groups related fields. Groups are currently output as a <fieldset> element, with a <legend>. For example, this schema:

{
    groups: [
        {
            legend: "User Details",
            fields: [
                {
                    type: "input",
                    inputType: "text",
                    label: "Name",
                    model: "name"
                },
                {
                    type: "input",
                    inputType: "number",
                    id: "current_age",
                    label: "Age",
                    model: "age"
                }
            ]
        }
    ]
}

would produce (simplified) HTML output something like this:

<fieldset>
    <legend>User Details</legend>
    
    <label>Name</label>
    <input type="text" />
    
    <label>Age</label>
    <input type="number" />
</fieldset>

You can change the default fieldset tag by passing the tag property to the <vue-form-generator /> component in your markup.

<vue-form-generator tag="div" :model="model" :schema="schema" :options="options"></vue-form-generator>