Skip to content

Releases: FrontLabsOfficial/vue-tiny-validate

v0.2.4

23 Aug 14:26
Compare
Choose a tag to compare
  • Fix result value is touched / dirtied before finishing test.

v0.2.2

25 Jul 14:43
Compare
Choose a tag to compare
  • Fix wrong result when data has multiple nested properties.
  • Async $test method.
await result.$test();
console.log('Tested');
  • Cancel async validation on resetting.
  • Add more parameters (data, rules, options) to test function. Also, update rule properties.
const rules = reactive({
  name: {
    // rule now has (name, test, message) properties instead of ($key, $test, $message) properties
    name: 'required',
    test: (value, data, rules, options) => {
      // you can access data, rules, options here
      return Boolean(value);
    },
    message: 'Name must not be empty.',
  },
});
  • Support Vue 2.
  • Add transform option.

v0.2.1

11 Jul 16:06
Compare
Choose a tag to compare
  • New options parameter. See documentation for more detail.
  • Support async validate function
const rules = reactive({
  name: {
    name: 'required',
    test: (value) => new Promise(resolve => {
      resolve(true);
    });
  }
})
  • Clear entry data ($error, $invalid, $messages) on resetting.

v0.2.0

16 Jun 05:39
Compare
Choose a tag to compare
  • Support Ref data and Ref rules.
export default {
  setup() {
    const data = ref({ name: 'Evelyn' });
    const rules = ref({
      name: {
        name: 'required',
        test: value => Boolean(value),
        message: 'Name must not be empty.',
      },
    });

    const { result } = useValidate(data, rules);

    return { result, data };
  },
};

v0.1.3

13 Jun 10:57
Compare
Choose a tag to compare
  • Convert from JS to TS.
  • Fix wrong default result.