Install & Download:
# Yarn
$ yarn add vue-credit-card-validation
# NPM
$ npm install vue-credit-card-validation --saveDescription:
A credit card validation plugin to format, mask, validate credit card number, expiration, CVC, card brand in your Vue.js app.
How to use it:
1. Install and import the credit-card-validation.
import VueCardFormat from 'vue-credit-card-validation';
2. Register the plugin.
Vue.use(VueCardFormat);
new Vue({
el: '#app',
});3. Format & validate credit card form fields using the v-cardformat directive as follows:
<form>
<div class="number">
<label>Number</label>
<input v-cardformat:formatCardNumber>
</div>
<div class="expiration">
<label>Expiry</label>
<input v-cardformat:formatCardExpiry>
</div>
<div class="cvc">
<label>Card CVC</label>
<input v-cardformat:formatCardCVC>
</div>
<div class="restrictNumeric">
<label>Numeric input</label>
<input v-cardformat:restrictNumeric>
</div>
<button>Submit</button>
</form>Preview:

Changelog:
v1.0.5 (04/06/2022)
- Fixed Brand not updating on number paste.
v1.0.2 (09/16/2020)
- Updates for Vue 3 compatibility.
v0.2.0 (09/15/2020)
- Fixes extra card number input.
v0.1.10 (10/25/2020)
- dependency updates.





