feat: useForm ts type
							parent
							
								
									cf60f9c46f
								
							
						
					
					
						commit
						39c866eb02
					
				| 
						 | 
				
			
			@ -27,6 +27,7 @@ import { useInjectSize } from '../_util/hooks/useSize';
 | 
			
		|||
import useConfigInject from '../_util/hooks/useConfigInject';
 | 
			
		||||
import { useProvideForm } from './context';
 | 
			
		||||
import type { SizeType } from '../config-provider';
 | 
			
		||||
import useForm from './useForm';
 | 
			
		||||
 | 
			
		||||
export type RequiredMark = boolean | 'optional';
 | 
			
		||||
export type FormLayout = 'horizontal' | 'inline' | 'vertical';
 | 
			
		||||
| 
						 | 
				
			
			@ -97,6 +98,7 @@ const Form = defineComponent({
 | 
			
		|||
    colon: true,
 | 
			
		||||
  }),
 | 
			
		||||
  Item: FormItem,
 | 
			
		||||
  useForm,
 | 
			
		||||
  emits: ['finishFailed', 'submit', 'finish'],
 | 
			
		||||
  setup(props, { emit, slots, expose, attrs }) {
 | 
			
		||||
    const size = useInjectSize(props);
 | 
			
		||||
| 
						 | 
				
			
			@ -371,4 +373,5 @@ const Form = defineComponent({
 | 
			
		|||
 | 
			
		||||
export default Form as typeof Form & {
 | 
			
		||||
  readonly Item: typeof FormItem;
 | 
			
		||||
  readonly useForm: typeof useForm;
 | 
			
		||||
};
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -15,7 +15,6 @@ Form.install = function (app: App) {
 | 
			
		|||
 | 
			
		||||
export { FormItem, formItemProps, formProps, useForm };
 | 
			
		||||
 | 
			
		||||
Form.useForm = useForm;
 | 
			
		||||
export default Form as typeof Form &
 | 
			
		||||
  Plugin & {
 | 
			
		||||
    readonly Item: typeof Form.Item;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										2
									
								
								v2-doc
								
								
								
								
							
							
								
								
								
								
								
								
							
						
						
									
										2
									
								
								v2-doc
								
								
								
								
							| 
						 | 
				
			
			@ -1 +1 @@
 | 
			
		|||
Subproject commit 128334b46af72232ea0dcc31540128ae53ae747d
 | 
			
		||||
Subproject commit d2c096476ee3e8d27fbb9e1cb7933887501b1fab
 | 
			
		||||
		Loading…
	
		Reference in New Issue