File tree Expand file tree Collapse file tree 3 files changed +17
-4
lines changed Expand file tree Collapse file tree 3 files changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ import type {
22
22
RuleError ,
23
23
ValidateErrorEntity ,
24
24
ValidateOptions ,
25
+ Callbacks ,
25
26
} from './interface' ;
26
27
import { useInjectSize } from '../_util/hooks/useSize' ;
27
28
import useConfigInject from '../_util/hooks/useConfigInject' ;
@@ -76,11 +77,13 @@ export const formProps = {
76
77
// 提交失败自动滚动到第一个错误字段
77
78
scrollToFirstError : { type : [ Boolean , Object ] as PropType < boolean | Options > } ,
78
79
onSubmit : PropTypes . func ,
79
- onFinish : PropTypes . func ,
80
- onFinishFailed : PropTypes . func ,
81
80
name : PropTypes . string ,
82
81
validateTrigger : { type : [ String , Array ] as PropType < string | string [ ] > } ,
83
82
size : { type : String as PropType < SizeType > } ,
83
+ onValuesChange : { type : Function as PropType < Callbacks [ 'onValuesChange' ] > } ,
84
+ onFieldsChange : { type : Function as PropType < Callbacks [ 'onFieldsChange' ] > } ,
85
+ onFinish : { type : Function as PropType < Callbacks [ 'onFinish' ] > } ,
86
+ onFinishFailed : { type : Function as PropType < Callbacks [ 'onFinishFailed' ] > } ,
84
87
} ;
85
88
86
89
export type FormProps = Partial < ExtractPropTypes < typeof formProps > > ;
Original file line number Diff line number Diff line change @@ -274,8 +274,16 @@ export default defineComponent({
274
274
275
275
useProvideFormItemContext ( {
276
276
id : fieldId ,
277
- onFieldBlur,
278
- onFieldChange,
277
+ onFieldBlur : ( ) => {
278
+ if ( props . autoLink ) {
279
+ onFieldBlur ( ) ;
280
+ }
281
+ } ,
282
+ onFieldChange : ( ) => {
283
+ if ( props . autoLink ) {
284
+ onFieldChange ( ) ;
285
+ }
286
+ } ,
279
287
clearValidate,
280
288
} ) ;
281
289
let registered = false ;
Original file line number Diff line number Diff line change @@ -3,10 +3,12 @@ import Form, { formProps } from './Form';
3
3
import FormItem , { formItemProps } from './FormItem' ;
4
4
import useForm from './useForm' ;
5
5
import { useInjectFormItemContext } from './FormItemContext' ;
6
+ export type { Rule , RuleObject } from './interface' ;
6
7
7
8
export type { FormProps } from './Form' ;
8
9
export type { FormItemProps } from './FormItem' ;
9
10
11
+ Form . useInjectFormItemContext = useInjectFormItemContext ;
10
12
/* istanbul ignore next */
11
13
Form . install = function ( app : App ) {
12
14
app . component ( Form . name , Form ) ;
You can’t perform that action at this time.
0 commit comments