fix: global validateMessages no work, close #5599

pull/4415/head
tangjinzhou 2022-05-15 10:14:11 +08:00
parent 40be639b63
commit 7a91110326
2 changed files with 3 additions and 0 deletions

View File

@ -4,6 +4,7 @@ import { computed, inject } from 'vue';
import type { ConfigProviderProps, CSPConfig, Direction, SizeType } from '../../config-provider'; import type { ConfigProviderProps, CSPConfig, Direction, SizeType } from '../../config-provider';
import { defaultConfigProvider } from '../../config-provider'; import { defaultConfigProvider } from '../../config-provider';
import type { VueNode } from '../type'; import type { VueNode } from '../type';
import type { ValidateMessages } from '../../form/interface';
export default ( export default (
name: string, name: string,
@ -20,6 +21,7 @@ export default (
form?: ComputedRef<{ form?: ComputedRef<{
requiredMark?: RequiredMark; requiredMark?: RequiredMark;
colon?: boolean; colon?: boolean;
validateMessages?: ValidateMessages;
}>; }>;
autoInsertSpaceInButton: ComputedRef<boolean>; autoInsertSpaceInButton: ComputedRef<boolean>;
renderEmpty?: ComputedRef<(componentName?: string) => VueNode>; renderEmpty?: ComputedRef<(componentName?: string) => VueNode>;

View File

@ -130,6 +130,7 @@ const Form = defineComponent({
const validateMessages = computed(() => { const validateMessages = computed(() => {
return { return {
...defaultValidateMessages, ...defaultValidateMessages,
...contextForm.value?.validateMessages,
...props.validateMessages, ...props.validateMessages,
}; };
}); });