Vue-form-generator: Nested and conditional fields

Created on 9 Mar 2017  路  7Comments  路  Source: vue-generators/vue-form-generator

Hi, very practical package.

I have checked documentation and live examples but could not find solutions for my questions. Maybe I missed it.

1- Is it possible to have nested form fields. My intention is only for generating wrappers for some form fields in HTML. I need to have the following schema.

schema: {
    fields: [{
        type: "group",
        label: "Group 1",
        fields: [
            {
                type: "input",
                inputType: "text",
                label: "Name",
                model: "name",
                placeholder: "Your name",
                featured: true,
                required: true
            },
            {
                type: "input",
                inputType: "password",
                label: "Password",
                model: "password",
                min: 6,
                required: true,
                hint: "Minimum 6 characters",
                validator: VueFormGenerator.validators.string
            }
        ]
    },{
        type: "group",
        label: "Group 2",
        fields: [
            {
                type: "select",
                label: "skills",
                model: "type",      
                values: ["Javascript", "VueJS", "CSS3", "HTML5"]
            },{
                type: "input",
                inputType: "email",
                label: "E-mail",
                model: "email",
                placeholder: "User's e-mail address"
            },{
                type: "checkbox",
                label: "Status",
                model: "status",
                default: true
            }
        ]
    }]
}

2- What about conditional form fields? For example if I enable a switch, several other form fields will be visible.

Thanks in advance,

question

Most helpful comment

All 7 comments

Hello,

  1. currently there is no grouping feature. It is only our TODO list
    But you can solve it with two vue-form-generator

  2. Every field have a visible & disabled properties, which can be also a function. Example in dev

Thanks for the fast answer.

  1. I wait but if you have any hint at the moment, please share it.

  2. Thanks

Docs say there is grouping? Are the docs just ahead of time?

Yes, there is a PR about grouping, but not merged yet.

Cool. Any idea when it'll be merged on?

I hope in this week.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

icebob picture icebob  路  4Comments

reardestani picture reardestani  路  5Comments

icetee picture icetee  路  4Comments

zwx00 picture zwx00  路  3Comments

afourmeaux picture afourmeaux  路  4Comments