fix: 修复单词拼写错误,replace 'Filed' width 'Feild' (#2285)

This commit is contained in:
前端爱码士 2022-10-17 09:07:09 +08:00 committed by GitHub
parent b1f78c6696
commit 9aa2cf3ebf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 13 additions and 13 deletions

View File

@ -174,7 +174,7 @@
updateSchema, updateSchema,
resetSchema, resetSchema,
appendSchemaByField, appendSchemaByField,
removeSchemaByFiled, removeSchemaByFeild,
resetFields, resetFields,
scrollToField, scrollToField,
} = useFormEvents({ } = useFormEvents({
@ -268,7 +268,7 @@
updateSchema, updateSchema,
resetSchema, resetSchema,
setProps, setProps,
removeSchemaByFiled, removeSchemaByFeild,
appendSchemaByField, appendSchemaByField,
clearValidate, clearValidate,
validateFields, validateFields,

View File

@ -79,8 +79,8 @@ export function useForm(props?: Props): UseFormReturnType {
}); });
}, },
removeSchemaByFiled: async (field: string | string[]) => { removeSchemaByFeild: async (field: string | string[]) => {
unref(formRef)?.removeSchemaByFiled(field); unref(formRef)?.removeSchemaByFeild(field);
}, },
// TODO promisify // TODO promisify

View File

@ -112,7 +112,7 @@ export function useFormEvents({
/** /**
* @description: Delete based on field name * @description: Delete based on field name
*/ */
async function removeSchemaByFiled(fields: string | string[]): Promise<void> { async function removeSchemaByFeild(fields: string | string[]): Promise<void> {
const schemaList: FormSchema[] = cloneDeep(unref(getSchema)); const schemaList: FormSchema[] = cloneDeep(unref(getSchema));
if (!fields) { if (!fields) {
return; return;
@ -123,7 +123,7 @@ export function useFormEvents({
fieldList = [fields]; fieldList = [fields];
} }
for (const field of fieldList) { for (const field of fieldList) {
_removeSchemaByFiled(field, schemaList); _removeSchemaByFeild(field, schemaList);
} }
schemaRef.value = schemaList; schemaRef.value = schemaList;
} }
@ -131,7 +131,7 @@ export function useFormEvents({
/** /**
* @description: Delete based on field name * @description: Delete based on field name
*/ */
function _removeSchemaByFiled(field: string, schemaList: FormSchema[]): void { function _removeSchemaByFeild(field: string, schemaList: FormSchema[]): void {
if (isString(field)) { if (isString(field)) {
const index = schemaList.findIndex((schema) => schema.field === field); const index = schemaList.findIndex((schema) => schema.field === field);
if (index !== -1) { if (index !== -1) {
@ -306,7 +306,7 @@ export function useFormEvents({
updateSchema, updateSchema,
resetSchema, resetSchema,
appendSchemaByField, appendSchemaByField,
removeSchemaByFiled, removeSchemaByFeild,
resetFields, resetFields,
setFieldsValue, setFieldsValue,
scrollToField, scrollToField,

View File

@ -33,7 +33,7 @@ export interface FormActionType {
updateSchema: (data: Partial<FormSchema> | Partial<FormSchema>[]) => Promise<void>; updateSchema: (data: Partial<FormSchema> | Partial<FormSchema>[]) => Promise<void>;
resetSchema: (data: Partial<FormSchema> | Partial<FormSchema>[]) => Promise<void>; resetSchema: (data: Partial<FormSchema> | Partial<FormSchema>[]) => Promise<void>;
setProps: (formProps: Partial<FormProps>) => Promise<void>; setProps: (formProps: Partial<FormProps>) => Promise<void>;
removeSchemaByFiled: (field: string | string[]) => Promise<void>; removeSchemaByFeild: (field: string | string[]) => Promise<void>;
appendSchemaByField: ( appendSchemaByField: (
schema: FormSchema, schema: FormSchema,
prefixField: string | undefined, prefixField: string | undefined,

View File

@ -21,7 +21,7 @@
export default defineComponent({ export default defineComponent({
components: { BasicForm, CollapseContainer, PageWrapper, [Input.name]: Input, Button }, components: { BasicForm, CollapseContainer, PageWrapper, [Input.name]: Input, Button },
setup() { setup() {
const [register, { appendSchemaByField, removeSchemaByFiled, validate }] = useForm({ const [register, { appendSchemaByField, removeSchemaByFeild, validate }] = useForm({
schemas: [ schemas: [
{ {
field: 'field0a', field: 'field0a',
@ -108,7 +108,7 @@
} }
function del(field) { function del(field) {
removeSchemaByFiled([`field${field}a`, `field${field}b`, `${field}`]); removeSchemaByFeild([`field${field}a`, `field${field}b`, `${field}`]);
n.value--; n.value--;
} }

View File

@ -181,7 +181,7 @@
export default defineComponent({ export default defineComponent({
components: { BasicForm, CollapseContainer, PageWrapper }, components: { BasicForm, CollapseContainer, PageWrapper },
setup() { setup() {
const [register, { setProps, updateSchema, appendSchemaByField, removeSchemaByFiled }] = const [register, { setProps, updateSchema, appendSchemaByField, removeSchemaByFeild }] =
useForm({ useForm({
labelWidth: 120, labelWidth: 120,
schemas, schemas,
@ -229,7 +229,7 @@
); );
} }
function deleteField() { function deleteField() {
removeSchemaByFiled('field11'); removeSchemaByFeild('field11');
} }
return { return {
register, register,