feat: add formItemInstance type
parent
7dda6e8e07
commit
23f5fba013
|
@ -74,7 +74,7 @@ export { default as Drawer } from './drawer';
|
||||||
export type { EmptyProps } from './empty';
|
export type { EmptyProps } from './empty';
|
||||||
export { default as Empty } from './empty';
|
export { default as Empty } from './empty';
|
||||||
|
|
||||||
export type { FormProps, FormItemProps, FormInstance } from './form';
|
export type { FormProps, FormItemProps, FormInstance, FormItemInstance } from './form';
|
||||||
export { default as Form, FormItem, FormItemRest } from './form';
|
export { default as Form, FormItem, FormItemRest } from './form';
|
||||||
|
|
||||||
export { default as Grid } from './grid';
|
export { default as Grid } from './grid';
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import type { PropType, ExtractPropTypes, ComputedRef, Ref } from 'vue';
|
import type { PropType, ExtractPropTypes, ComputedRef, Ref, ComponentPublicInstance } from 'vue';
|
||||||
import {
|
import {
|
||||||
watch,
|
watch,
|
||||||
defineComponent,
|
defineComponent,
|
||||||
|
@ -99,6 +99,15 @@ export const formItemProps = {
|
||||||
|
|
||||||
export type FormItemProps = Partial<ExtractPropTypes<typeof formItemProps>>;
|
export type FormItemProps = Partial<ExtractPropTypes<typeof formItemProps>>;
|
||||||
|
|
||||||
|
export type FormItemExpose = {
|
||||||
|
onFieldBlur: () => void;
|
||||||
|
onFieldChange: () => void;
|
||||||
|
clearValidate: () => void;
|
||||||
|
resetField: () => void;
|
||||||
|
};
|
||||||
|
|
||||||
|
export type FormItemInstance = ComponentPublicInstance<FormItemProps, FormItemExpose>;
|
||||||
|
|
||||||
let indexGuid = 0;
|
let indexGuid = 0;
|
||||||
|
|
||||||
// default form item id prefix.
|
// default form item id prefix.
|
||||||
|
|
|
@ -6,7 +6,7 @@ import FormItemRest, { useInjectFormItemContext } from './FormItemContext';
|
||||||
export type { Rule, RuleObject } from './interface';
|
export type { Rule, RuleObject } from './interface';
|
||||||
|
|
||||||
export type { FormProps, FormInstance } from './Form';
|
export type { FormProps, FormInstance } from './Form';
|
||||||
export type { FormItemProps } from './FormItem';
|
export type { FormItemProps, FormItemInstance } from './FormItem';
|
||||||
|
|
||||||
Form.useInjectFormItemContext = useInjectFormItemContext;
|
Form.useInjectFormItemContext = useInjectFormItemContext;
|
||||||
Form.ItemRest = FormItemRest;
|
Form.ItemRest = FormItemRest;
|
||||||
|
|
Loading…
Reference in New Issue