Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat verify failed rules #1916

Merged
merged 4 commits into from
Mar 11, 2019
Merged

Feat verify failed rules #1916

merged 4 commits into from
Mar 11, 2019

Conversation

logaretm
Copy link
Owner

This PR adds failedRules to the Validator.verify result and to the ValidationProvider slot-scope props, which is very useful if someone wants to do UI customizations based on the failed rules.

<ValidationProvider rules="required|email" name="field">
  <div slot-scope="{ errors, failedRules }">
    <input type="text" v-model="value">
    <span v-if="failedRules.required">Come on, this is required!</span>
    <span v-if="failedRules.email">Have you ever seen an email like the one you just wrote?</span>
  </div>
</ValidationProvider>

closes #1898

@codecov
Copy link

codecov bot commented Mar 11, 2019

Codecov Report

Merging #1916 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1916      +/-   ##
==========================================
+ Coverage   96.11%   96.12%   +0.01%     
==========================================
  Files          60       60              
  Lines        2291     2297       +6     
  Branches      714      714              
==========================================
+ Hits         2202     2208       +6     
  Misses         80       80              
  Partials        9        9
Impacted Files Coverage Δ
src/components/provider.js 90.9% <100%> (+0.04%) ⬆️
src/core/validator.js 98.57% <100%> (+0.02%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0a543c1...d9e675a. Read the comment docs.

@logaretm logaretm merged commit 546f694 into logaretm:master Mar 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Validation Provider access to invalid rules
1 participant