Closed christianmls closed 3 years ago
You can get it using refs
. See this example below:
<template>
<div>
<vue-paycard ref="card" :value-fields="valueFields" />
<button @click="getCardType">Card Type</button>
</div>
</template>
<script>
export default {
data: () => ({
valueFields: {
cardName: "",
cardNumber: "4444 4444 4444 4444",
cardMonth: "",
cardYear: "",
cardCvv: "",
},
}),
methods: {
getCardType() {
console.log(this.$refs.card.cardType)
}
}
};
</script>
That console.log
will print visa
once you clicked that button.
Hope that helps.
How can I get card type?