lbgm/phone-number-input

Dynamic default Country

Closed this issue · 3 comments

Hi, I started using this package and I have a problem using a dynamic value for defaultCountry.

I set a default country with a value, however, When I try to update that value from a service I realize the value has changed, but the default country code isn't the new value

`<script setup lang="ts">
import { PhoneInput } from '@lbgm/phone-number-input'
import '@lbgm/phone-number-input/style'
import { geolocate } from '@/services/Ip/Ip'

import { onMounted, ref, watch } from 'vue'

const DEFAULT_COUNTRY_CODE = 'CL'
const ALLOWED_COUNTRY_CODES = ['AR', 'CL']

const countryCode = ref(DEFAULT_COUNTRY_CODE)

onMounted(async () => {
try {
const geolocationResponse: Object = await geolocate()

countryCode.value = geolocationResponse.data.country_code2 ?? DEFAULT_COUNTRY_CODE

} catch (error) {
console.log(error)
}
})
</script>

`
lbgm commented

hi @quevlu . thanks for opening this issue.

lbgm commented

we will work on it !

lbgm commented

We upgraded vue-tsc version and also move from Node.js 14.18.3 to 16.20.1.