Skip to content

v2.0.0-beta5

Pre-release
Pre-release
Compare
Choose a tag to compare
@icebob icebob released this 01 Mar 10:37
· 404 commits to master since this release

Break changes

Removed deprecated fields. #121

If you are using text, number, color, email, password or range field type in schema, please change it to input and set the type into inputType property. Example:

Old way

    {
        type: "text"
    },
    {
        type: "number"
    }

New way

    {
        type: "input"
        inputType: "text"
    },
    {
        type: "input"
        inputType: "number"
    }

Created two separated & renamed bundle file: full and core #121

Core is a more minimal version with only half the fields.
Full is core + other fields.

  • Full bundle: 75 kB (gzipped: 19 kB)
  • Core bundle: 39 kB (gzipped: 11 kB)

If you don't know what to choose, don't worry, the full is the default version.
If you want the slim down version, here is the changes:

// the "core" way
<script>
  import VueFormGenerator from "vue-form-generator/dist/vfg-core.js";
  import "vue-form-generator/dist/vfg-core.css";
</script>

Validation error handling changed #128 #109

  1. VFG component emits a validated event, if validation executed. Event parameters: isValid: boolean, errors: Array

Example:

<vue-form-generator @validated="onValidated" />

...

methods:{
  onValidated(isValid, errors) {
   console.log("Validation result: ", isValid, ", Errors:", errors);
  }
}
  1. Fields validation schema.errors issue is fixed. Now errors in the local data. The communication with parent is event-based (similar @validated solution)
  2. Fix this in schema functions. Now this is always the instance of vfg. Parameters: model, fieldSchema, vfg

Other important updates

  • removed unneccessary dependencies #112
  • removed momentjs dependency and switch to fecha (more lightweight) #117
  • upgrade from jade to pug #132
  • improve validation error handling & events #129