fix: global validateMessages no work, close #5599
parent
40be639b63
commit
7a91110326
|
@ -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>;
|
||||||
|
|
|
@ -130,6 +130,7 @@ const Form = defineComponent({
|
||||||
const validateMessages = computed(() => {
|
const validateMessages = computed(() => {
|
||||||
return {
|
return {
|
||||||
...defaultValidateMessages,
|
...defaultValidateMessages,
|
||||||
|
...contextForm.value?.validateMessages,
|
||||||
...props.validateMessages,
|
...props.validateMessages,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue