941477276 / vue3-country-intl

基于vue3的国际化的国籍/手机区号组件!
30 stars 3 forks source link

默认选择区号问题 #7

Closed shallow-time closed 1 year ago

shallow-time commented 1 year ago

scheme = input,type = phone,设置默认iso2为'us', 默认区号为‘1’,期望实现效果默认选择的是美国区号,实际却是不显示。

代码:

 <template> 
  <div>
       <Vue3CountryIntl :iso2="iso2"  type="phone" v-model="area_code" @onChange="handleChange"></Vue3CountryIntl>
  </div>
 </template>

 <script lang="ts" setup>
 import {ref} from 'vue';
 const iso2  = ref('us') // 期望默认区号为美国
 const area_code = ref('1')
 const handleChange = (options:any) =>{
    iso2.value = options.value
 }
</script>

效果显示:未成功显示期望的默认区号 image

941477276 commented 1 year ago

升级到1.0.16版本可解决该问题 image image image

shallow-time commented 1 year ago

升级到1.0.16版本可解决该问题 image image image

vue: 3.2.36 版本,vue3-country-intl: 1.0.16 版本。依旧存在设置默认区号为美国,不显示问题,看下你这边vue版本是多少,确认下是不是vue版本导致的。 image image image

941477276 commented 1 year ago

我用3.2.36版本的vue也是可以的 image image image image 你新创建一个vue3项目,在新项目里使用vue3-country-intl组件看有没有效果