From bfbcdaf9b0e827d96de24f95e622a175dc8332ee Mon Sep 17 00:00:00 2001 From: tangjinzhou <415800467@qq.com> Date: Tue, 1 Mar 2022 16:49:57 +0800 Subject: [PATCH] style: update locale ts --- components/locale-provider/LocaleReceiver.tsx | 8 +++----- components/locale-provider/bn_BD.ts | 3 +++ components/locale-provider/ka_GE.ts | 3 +++ components/locale-provider/km_HK.ts | 3 +++ components/locale-provider/ml_IN.ts | 3 +++ components/locale-provider/ur_PK.ts | 3 +++ 6 files changed, 18 insertions(+), 5 deletions(-) create mode 100644 components/locale-provider/bn_BD.ts create mode 100644 components/locale-provider/ka_GE.ts create mode 100644 components/locale-provider/km_HK.ts create mode 100644 components/locale-provider/ml_IN.ts create mode 100644 components/locale-provider/ur_PK.ts diff --git a/components/locale-provider/LocaleReceiver.tsx b/components/locale-provider/LocaleReceiver.tsx index 1fb6dc036..afc946b8b 100644 --- a/components/locale-provider/LocaleReceiver.tsx +++ b/components/locale-provider/LocaleReceiver.tsx @@ -1,8 +1,8 @@ import type { VNodeTypes, PropType, ComputedRef, Ref } from 'vue'; import { unref, inject, defineComponent, computed } from 'vue'; -import PropTypes from '../_util/vue-types'; import defaultLocaleData from './default'; import type { Locale } from '.'; +export type LocaleComponentName = Exclude; export interface LocaleReceiverProps { componentName?: string; @@ -21,7 +21,7 @@ export interface LocaleReceiverContext { export default defineComponent({ name: 'LocaleReceiver', props: { - componentName: PropTypes.string, + componentName: String as PropType, defaultLocale: { type: [Object, Function], }, @@ -62,9 +62,7 @@ export default defineComponent({ }, }); -type LocaleComponent = keyof Locale; - -export function useLocaleReceiver( +export function useLocaleReceiver( componentName: T, defaultLocale?: Locale[T] | Function | ComputedRef, propsLocale?: Ref, diff --git a/components/locale-provider/bn_BD.ts b/components/locale-provider/bn_BD.ts new file mode 100644 index 000000000..a5e02075e --- /dev/null +++ b/components/locale-provider/bn_BD.ts @@ -0,0 +1,3 @@ +import locale from '../locale/bn_BD'; + +export default locale; diff --git a/components/locale-provider/ka_GE.ts b/components/locale-provider/ka_GE.ts new file mode 100644 index 000000000..4c97bc049 --- /dev/null +++ b/components/locale-provider/ka_GE.ts @@ -0,0 +1,3 @@ +import locale from '../locale/ka_GE'; + +export default locale; diff --git a/components/locale-provider/km_HK.ts b/components/locale-provider/km_HK.ts new file mode 100644 index 000000000..f8a210be1 --- /dev/null +++ b/components/locale-provider/km_HK.ts @@ -0,0 +1,3 @@ +import locale from '../locale/km_KH'; + +export default locale; diff --git a/components/locale-provider/ml_IN.ts b/components/locale-provider/ml_IN.ts new file mode 100644 index 000000000..639f1f1b5 --- /dev/null +++ b/components/locale-provider/ml_IN.ts @@ -0,0 +1,3 @@ +import locale from '../locale/ml_IN'; + +export default locale; diff --git a/components/locale-provider/ur_PK.ts b/components/locale-provider/ur_PK.ts new file mode 100644 index 000000000..64722eb28 --- /dev/null +++ b/components/locale-provider/ur_PK.ts @@ -0,0 +1,3 @@ +import locale from '../locale/ur_PK'; + +export default locale;