question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Using formvuelate + vee-validate one_of rule

See original GitHub issue

Hello,

Can you give me an hand to get working vee-validate one_of ? I’m using the following code. Validation is working well except “one_of” rule. I use it to check passwords are same before sign up. It looks that “one_of” rule doesn’t get password current value.

const userData = reactive({
  name: '',
  email: '',
  password: ''
});

const SCHEMA = {
  password: {
    component: 'FormText',
    type: 'password',
    placeholder: 'password',
    validations: { required, min: {length: 8}  },
  },
  confirmPassword: {
    component: 'FormText',
    type: 'password',
    placeholder: 'confirm-password',
    validations: { required, min: {length: 8}, one_of: userData.password  },
  },
};

useSchemaForm(userData);
const schema = computed(() => { return SCHEMA });

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
logaretmcommented, Oct 20, 2021

In your example the schema is not reactive, so you need to make it a computed schema since you want the matching to change every time the other field changes.

0reactions
scramattecommented, Oct 20, 2021

Hello,

sorry but I think that is related to Fvl…

As @logaretm told me I’ve put value between bracket and still doesn’t works because when you define schema validations one_of value is not reactive.

Please send me a link to sandbox.io with fvl+vee-validate plugin and I prepare you an example.

Regards

Read more comments on GitHub >

github_iconTop Results From Across the Web

Custom Rules - VeeValidate
As you can see, a validation rule must implement one of the two forms discussed above. Not doing so will throw an exception...
Read more >
Vee-Validate Plugin - FormVueLate
The vee-validate plugin lets you validate your generated fields using ... There are two approaches to specify validation rules to your schema fields, ......
Read more >
How to use oneOf on dynamic select lists? #2251 - GitHub
As you can see, i'm using city.id as an option value, but how to send that to a rule? Also it doesn't work...
Read more >
SchemaForm - FormVueLate
<template> <SchemaForm :schema="mySchema" v-model="formData" /> </template> <script> import { ref } from 'vue' export default { setup() { const formData ...
Read more >
@formvuelate/plugin-vee-validate examples - CodeSandbox
Learn how to use @formvuelate/plugin-vee-validate by viewing and forking @formvuelate/plugin-vee-validate example apps on CodeSandbox.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found