Skip to content

Commit 39c866e

Browse files
committed
feat: useForm ts type
1 parent cf60f9c commit 39c866e

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

components/form/Form.tsx

+3
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import { useInjectSize } from '../_util/hooks/useSize';
2727
import useConfigInject from '../_util/hooks/useConfigInject';
2828
import { useProvideForm } from './context';
2929
import type { SizeType } from '../config-provider';
30+
import useForm from './useForm';
3031

3132
export type RequiredMark = boolean | 'optional';
3233
export type FormLayout = 'horizontal' | 'inline' | 'vertical';
@@ -97,6 +98,7 @@ const Form = defineComponent({
9798
colon: true,
9899
}),
99100
Item: FormItem,
101+
useForm,
100102
emits: ['finishFailed', 'submit', 'finish'],
101103
setup(props, { emit, slots, expose, attrs }) {
102104
const size = useInjectSize(props);
@@ -371,4 +373,5 @@ const Form = defineComponent({
371373

372374
export default Form as typeof Form & {
373375
readonly Item: typeof FormItem;
376+
readonly useForm: typeof useForm;
374377
};

components/form/index.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ Form.install = function (app: App) {
1515

1616
export { FormItem, formItemProps, formProps, useForm };
1717

18-
Form.useForm = useForm;
1918
export default Form as typeof Form &
2019
Plugin & {
2120
readonly Item: typeof Form.Item;

v2-doc

0 commit comments

Comments
 (0)