Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
49 lines (40 sloc) 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>
You can’t perform that action at this time.