Form Methods

The form validation framework wouldn't be complete without dynamically added fields and groups.

Inkline provides a simple API for adding and removing fields.

Object Group Operations

Just like Arrays, Objects can be manipulated and kept up to date using a custom API. You can use the set method to update an object field. To enable reactivity, we'll need to also pass in the current Vue instance inside the options to take advantage of it's internal methods.

this.form.group.set(name, item, options)

Form Schema Object Group Operations

You can use options.group to specify whether the value being set is a group of fields. If not specified or set to false, the field will be a standalone field.

Array Group Operations

Inkline provides you with custom implementations for Array group operations using push andsplice. These two methods will take care of registering events and making sure your form schema is always up to date.

this.form.group.add(item, options)
this.form.group.remove(index, deleteCount, item, options)

Form Schema Array Group Operations

You can use options.group to specify whether the value being added is a group of fields. If not specified or set to false, the field will be a standalone field.