types: add SwipeInstance type (#9158)
This commit is contained in:
+3
-23
@@ -1,9 +1,4 @@
|
||||
import {
|
||||
PropType,
|
||||
defineComponent,
|
||||
ExtractPropTypes,
|
||||
ComponentPublicInstance,
|
||||
} from 'vue';
|
||||
import { PropType, defineComponent, ExtractPropTypes } from 'vue';
|
||||
|
||||
// Utils
|
||||
import { truthProp, createNamespace } from '../utils';
|
||||
@@ -19,6 +14,7 @@ import type {
|
||||
FieldValidateError,
|
||||
FieldValidateTrigger,
|
||||
} from '../field/types';
|
||||
import type { FormExpose } from './types';
|
||||
|
||||
const [name, bem] = createNamespace('form');
|
||||
|
||||
@@ -41,23 +37,7 @@ const props = {
|
||||
},
|
||||
};
|
||||
|
||||
type FormProps = ExtractPropTypes<typeof props>;
|
||||
|
||||
type FormExpose = {
|
||||
submit: () => void;
|
||||
validate: (name?: string | string[] | undefined) => Promise<void>;
|
||||
scrollToField: (
|
||||
name: string,
|
||||
options?: boolean | ScrollIntoViewOptions | undefined
|
||||
) => void;
|
||||
resetValidation: (name?: string | string[] | undefined) => void;
|
||||
};
|
||||
|
||||
export type FormInstance = ComponentPublicInstance<FormProps, FormExpose>;
|
||||
|
||||
export type FormProvide = {
|
||||
props: FormProps;
|
||||
};
|
||||
export type FormProps = ExtractPropTypes<typeof props>;
|
||||
|
||||
export default defineComponent({
|
||||
name,
|
||||
|
||||
+1
-1
@@ -5,4 +5,4 @@ const Form = withInstall<typeof _Form>(_Form);
|
||||
|
||||
export default Form;
|
||||
export { Form };
|
||||
export type { FormInstance } from './Form';
|
||||
export type { FormInstance } from './types';
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
import type { ComponentPublicInstance } from 'vue';
|
||||
import type { FormProps } from './Form';
|
||||
|
||||
export type FormExpose = {
|
||||
submit: () => void;
|
||||
validate: (name?: string | string[] | undefined) => Promise<void>;
|
||||
scrollToField: (
|
||||
name: string,
|
||||
options?: boolean | ScrollIntoViewOptions | undefined
|
||||
) => void;
|
||||
resetValidation: (name?: string | string[] | undefined) => void;
|
||||
};
|
||||
|
||||
export type FormProvide = {
|
||||
props: FormProps;
|
||||
};
|
||||
|
||||
export type FormInstance = ComponentPublicInstance<FormProps, FormExpose>;
|
||||
Reference in New Issue
Block a user