Getting A Value
You can get a value from Vue Simple Phone by just using v-model. The returned value will be a ParsedPhoneNumber from awesome-phonenumber
vue
<script setup>
import { ref } from 'vue'
import { VueSimplePhone } from 'vue-simple-phone'
import 'vue-simple-phone/themes/light.css' // Include the default theme
const phone = ref();
</script>
<template>
{{ phone }}
<VueSimplePhone v-model="phone" />
</template>Try out it right here! Try typing some numbers in the input below!
{
"number": {
"input": "(201) 555-0123",
"international": "+1 201-555-0123",
"national": "(201) 555-0123",
"e164": "+12015550123",
"rfc3966": "tel:+1-201-555-0123",
"significant": "2015550123"
},
"regionCode": "US",
"valid": true,
"possible": true,
"shortPossible": false,
"shortValid": false,
"canBeInternationallyDialled": true,
"possibility": "is-possible",
"type": "fixed-line-or-mobile",
"typeIsMobile": true,
"typeIsFixedLine": true,
"countryCode": 1
}