I am using vue-tel-input for entering a phone number.
Phone number entry
<vue-tel-input
v-model="phonenumber"
@validate="telValidate"
></vue-tel-input>
Method to check it is valid:
telValidate(telnumber) {
this.validatedphonenumber = telnumber.number;
this.validphonenumber = telnumber.valid;
},
Method to update phone number:
this.$axios.put("users/" + this.accountId, {
phonenumber: this.validatedphonenumber
});
So this will update the user with the complete telephone number as a string such as "+447766554433"
I am now trying to display this saved string in a vue-tel-input for the case of editing it. My questions are:
Firstly how do I bind the saved value to the vue-tel-input?
Secondly am I right in thinking that I would have to save the countryCallingCode and the nationalNumber from the number object sperately or is there way of extracting the two parts from the single stored value?