How to set validation in form like this using vee validate in vue.js
Image dimension less then 500*500 pixel
Image size less then 100kb
How to set validation in form like this using vee validate in vue.js
Image dimension less then 500*500 pixel
Image size less then 100kb
For two of those requirements, there are available ("native") rules:
image
rule.size:100
rule.Now, for the
...the problem is with the less.
The
dimensions
rule test for exact size. So you'll need to tweak it to test for size smaller than or equal to the size.A simple solution would be to take the code from the official implementation of the
dimensions
rule and change it to test for smaller or equal to.That's what the demo below does. It creates as
maxdimensions:500,500
rule.