What is the correct syntax for multiple rules
See original GitHub issueI have input fields that looks like this:
<input class="img1" type="file" v-validate ="{ rules: { required: imgGroupVal, image: true, size: 8192, mimes: 'image/jpeg,image/jpg,image/png', ext: 'jpg,jpeg,png' } }" >
<input class="img2" type="file" v-validate ="{ rules: { required: imgGroupVal, image: true, size: 8192, mimes: 'image/jpeg,image/jpg,image/png', ext: 'jpg,jpeg,png' } }" >
The only problem is that mimes: 'image/jpeg,image/jpg,image/png', ext: 'jpg,jpeg,png'
always fails.
I have also tried to write the rule like this:
v-validate="'required:imgGroupVal|image|size:8192|mimes:image/jpeg,image/jpg,image/png|ext:jpg,jpeg,png'"
But then my required rule doesnt work that is driven by a computed value imgGroupVal
So how do I need to change my syntax bellow in order to make it work
v-validate ="{ rules: { required: imgGroupVal, image: true, size: 8192, mimes: 'image/jpeg,image/jpg,image/png', ext: 'jpg,jpeg,png' } }"
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Rule syntax examples
The following example shows the syntax for a rule: TARGETS: CONDITIONS;. Use the following elements when creating a rule: You can have multiple...
Read more >Rule syntax
This document describes Semgrep's YAML rule syntax including required and optional fields. ... pattern-either *, array, Logical OR of multiple patterns.
Read more >IF AND in Excel: nested formula, multiple statements, and ...
The tutorial shows how to use IF together with the AND function in Excel to check multiple conditions in one formula.
Read more >CSS Syntax
CSS Syntax ... A CSS rule consists of a selector and a declaration block. ... Multiple CSS declarations are separated with semicolons, and...
Read more >GNU Make - Writing Rules
If the first rule has multiple targets, only the first target is taken as the ... the contents of the existing target file...
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 Free
Top 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
@logaretm oh I see. Well thanks again for the help! Its an awesome lib!
No, you will just pass it as an object directly which works fine, I didn’t update the example properly: