style: update locale ts

feat-css-var
tangjinzhou 3 years ago
parent ab74f26e4b
commit bfbcdaf9b0

@ -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<keyof Locale, 'locale'>;
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<LocaleComponentName>,
defaultLocale: {
type: [Object, Function],
},
@ -62,9 +62,7 @@ export default defineComponent({
},
});
type LocaleComponent = keyof Locale;
export function useLocaleReceiver<T extends LocaleComponent>(
export function useLocaleReceiver<T extends LocaleComponentName>(
componentName: T,
defaultLocale?: Locale[T] | Function | ComputedRef<Locale[T] | Function>,
propsLocale?: Ref<Locale[T]>,

@ -0,0 +1,3 @@
import locale from '../locale/bn_BD';
export default locale;

@ -0,0 +1,3 @@
import locale from '../locale/ka_GE';
export default locale;

@ -0,0 +1,3 @@
import locale from '../locale/km_KH';
export default locale;

@ -0,0 +1,3 @@
import locale from '../locale/ml_IN';
export default locale;

@ -0,0 +1,3 @@
import locale from '../locale/ur_PK';
export default locale;
Loading…
Cancel
Save