简体   繁体   中英

Remove country code from phone number vue-tel-input

I'm using vue-tel-input . It is working, but I want to remove the country code from the input field. I have tried using different modes (ie national and international ), but it is showing either +91 or 0 , but I want to remove that 0 or 91 from the field and input event.

在此处输入图像描述

onInput({ number, isValid, country }) {
  this.mobile=number.significant;
  this.country_code=country.dialCode;
},

You can hide both the leading 0 and the dial code ( +91 ) by disabling the auto formatting. The trade off is this disables all formatting for the number.

<vue-tel-input :autoFormat="false" ... />

demo

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM