Skip to content

stoneNIK/IntlTelInput

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

IntlTelInput

基于VUE的国际号码输入插件

调用方法DEMO

import intlTelInput from '../intlTelInput/index.vue'
export default {
    name: 'Reg',
    components: {
      intlTelInput
    },
    data () {
      return {
        formData: {
          'agree': true
        },
        errorMsg: '',
        actForm: 'email',
        countryCode: 'tr',
        dialCode: '90',
        phoneIpt: '',
        showCount: 0,
        submiting: false,
        err_notice: ''
      }
    },
    methods: {
      setCountryCode: function (item) {
        this.phoneIpt = item.phoneFormat
      },
      setCountryCode: function (item) {
        this.phoneIpt = item.phoneFormat
      },
      tabForm: function (_tab) {
        this.actForm = _tab
        this.formData = {'agree': true}
        if (_tab == 'phone') {
          this.$http.get('https://ipinfo.io')
            .then(response => {
              if (response.status == 200) {
                this.$nextTick(function () {
                  this.countryCode = response.data && response.data.country ? response.data.country.toLowerCase() : 'tr'
                })
              }
            })
        }
      }
    }

About

基于VUE的国际号码输入插件

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages