Using formvuelate + vee-validate one_of rule
See original GitHub issueHello,
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:
- Created 2 years ago
- Comments:5 (1 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
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