Skip to content

v2.0.0

Compare
Choose a tag to compare
@jarvelov jarvelov released this 25 Dec 19:39
· 309 commits to master since this release

Breaking release!

This update contains the following changes:

  • Removes non-prefixed props. Fixes #7
  • No longer merges new model with old one. Fixes #11
  • Improved handling of string values in fieldOptions.class
  • Added support for passing field model to custom prop
    • Previously the field's model was always passed to the value prop, but now it can be passed to any prop via the valueProp option. The default is still value.
      • Configure the valueProp on the field's root object:
      • or, to set the prop globally for all fields configure the valueProp property on the options object passed to the vue-form-json-schema component.
  • Named export changes
    • The project structure has been updated and the named exports have been updated to reflect that. If you only used the default export you will not have to change anything.
      • vfjsViewer -> vfjsGlobal
      • vfjsComponentMixin -> vfjsFieldMixin
      • New export: vfjsField

This is considered a major release due to changing the API with the removal of non-prefixed props. Previously a field's component would get passed the following non-prefixed props:

NOTE: You are only affected by this if your field's component made use of any of these props.
If you for example only used errorHandlerin the field's fieldOptionsyou are not affected by this change. If however your field's component used these props you will have to update to the prefixed version of the prop, see the list below. Note the exception for thevalue prop.

  • children
  • component
  • errorHandler
  • errorOptions
  • errors
  • fieldOptions
  • id
  • model
  • modelKey
  • required
  • schema
  • schemas
  • state
  • tag **
  • uiSchema
  • value *

* The field's model is still passed to the value prop unless the valueKey has been set, either globally or on the field, to another value.
** This property has been removed

As these props are no longer passed to the field's component. Instead use the following prefixed versions:

  • children -> vfjsChildren (or vfjsChildrenUiSchema to get the ui schema instead of the rendered nodes)
  • component -> vfjsComponent
  • errorHandler -> vfjsFieldErrorHandler
  • errorOptions -> vfjsFieldOptions
  • errors -> vfjsFieldErrors
  • fieldOptions -> vfjsFieldOptions
  • id -> vfjsFieldId
  • model -> vfjsFieldModel
  • modelKey -> vfjsFieldModelKey
  • required -> vfjsFieldRequired
  • schema -> vfjsFieldSchema
  • schemas -> vfjsFieldSchemas
  • state -> vfjsFieldState
  • uiSchema -> vfjsFieldUiSchema
  • value -> vfjsFieldModel
  • tag -> This property has been removed