Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: update default country code (#9101)

boojack147e1bfcaa3f
diff --git a/frontend/src/components/v2/Form/PhoneNumberInput.vue b/frontend/src/components/v2/Form/PhoneNumberInput.vue
index 92965bc0cd..445e5c66fd 100644
--- a/frontend/src/components/v2/Form/PhoneNumberInput.vue
+++ b/frontend/src/components/v2/Form/PhoneNumberInput.vue
@@ -3,7 +3,7 @@
v-model="state.phoneNumber"
no-example
:preferred-countries="['CN', 'US']"
- default-country-code="CN"
+ :default-country-code="defaultCountryCode"
size="sm"
:translations="translation"
@update="handleUpdate"
@@ -14,6 +14,7 @@
import MazPhoneNumberInput from "maz-ui/components/MazPhoneNumberInput";
import { computed, reactive, ref } from "vue";
import { useI18n } from "vue-i18n";
+import { useLanguage } from "@/composables/useLanguage";
const props = defineProps<{
value: string;
@@ -28,6 +29,7 @@ interface LocalState {
}
const { t } = useI18n();
+const { locale } = useLanguage();
const state = reactive<LocalState>({
phoneNumber: props.value,
});
@@ -47,6 +49,10 @@ const translation = computed(() => {
};
});
+const defaultCountryCode = computed(() => {
+ return locale.value === "zh-CN" ? "CN" : "US";
+});
+
const handleUpdate = (value: any) => {
results.value = value;
emit("update", value.e164);