Model
The model is a native JSON object. VueFormGenerator will modify this model if the values of the fields change. Model can be a multi-level object. In this case the model
of field will be like this:
Example
Merge & multiple models
If you would like to edit more models, first you have to merge these objects to a work object. For this, there is a helper function:
Parameters
schema
: schema object with fields. Merge only themulti: true
fieldsobjs
: array of models
Return
Returns the merged JSON object like this:
The function only set those value of properties, where multiple mode is enabled multi: true
in the fields and the values in every models are the same value.
Create new empty model
You can create a new model with default values. For this use the VueFormGenerator.schema.createDefaultObject
function. The first parameter can be a base object.
Example with a generated ID:
Result:
Note:
type
andstatus
field have default values in the schema.
Last updated