I looked the documentation of Vee validate before asking for help here, I have a problem with the use of custom rules with parameter. In fact, the configuration of my rules is fine but I don't find the correct syntax to make it work properly in the component with a parameter.
What should I write in the v-validate
features of the concerned field?
Thanks for your help,
Here is my rule:
import { Validator } from 'vee-validate';
Validator.extend('isBigger', (value, [otherValue]) => {
return value <= otherValue;
}, {
hasTarget: true
});
I tried this but not working:
<b-form-input ref="bottom"
name="sampling depth bottom"
v-validate="{regex: /^-?\d+[.,]?\d{0,10}$/}"
placeholder="(in cm)"
v-model="inputSamplingDepthBot"
></b-form-input>
<b-form-input
name="sampling depth top"
v-validate="{isBigger:'bottom', regex: /^-?\d+[.,]?\d{0,10}$/}"
placeholder="(in cm)"
v-model="inputSamplingDepthTop"
></b-form-input>