Commit 9aa2cf3ebff6f3d4087a1080208ec5f3c2c50f33
Committed by
GitHub
1 parent
b1f78c66
fix: 修复单词拼写错误,replace 'Filed' width 'Feild' (#2285)
Showing
6 changed files
with
13 additions
and
13 deletions
src/components/Form/src/BasicForm.vue
... | ... | @@ -174,7 +174,7 @@ |
174 | 174 | updateSchema, |
175 | 175 | resetSchema, |
176 | 176 | appendSchemaByField, |
177 | - removeSchemaByFiled, | |
177 | + removeSchemaByFeild, | |
178 | 178 | resetFields, |
179 | 179 | scrollToField, |
180 | 180 | } = useFormEvents({ |
... | ... | @@ -268,7 +268,7 @@ |
268 | 268 | updateSchema, |
269 | 269 | resetSchema, |
270 | 270 | setProps, |
271 | - removeSchemaByFiled, | |
271 | + removeSchemaByFeild, | |
272 | 272 | appendSchemaByField, |
273 | 273 | clearValidate, |
274 | 274 | validateFields, | ... | ... |
src/components/Form/src/hooks/useForm.ts
... | ... | @@ -79,8 +79,8 @@ export function useForm(props?: Props): UseFormReturnType { |
79 | 79 | }); |
80 | 80 | }, |
81 | 81 | |
82 | - removeSchemaByFiled: async (field: string | string[]) => { | |
83 | - unref(formRef)?.removeSchemaByFiled(field); | |
82 | + removeSchemaByFeild: async (field: string | string[]) => { | |
83 | + unref(formRef)?.removeSchemaByFeild(field); | |
84 | 84 | }, |
85 | 85 | |
86 | 86 | // TODO promisify | ... | ... |
src/components/Form/src/hooks/useFormEvents.ts
... | ... | @@ -112,7 +112,7 @@ export function useFormEvents({ |
112 | 112 | /** |
113 | 113 | * @description: Delete based on field name |
114 | 114 | */ |
115 | - async function removeSchemaByFiled(fields: string | string[]): Promise<void> { | |
115 | + async function removeSchemaByFeild(fields: string | string[]): Promise<void> { | |
116 | 116 | const schemaList: FormSchema[] = cloneDeep(unref(getSchema)); |
117 | 117 | if (!fields) { |
118 | 118 | return; |
... | ... | @@ -123,7 +123,7 @@ export function useFormEvents({ |
123 | 123 | fieldList = [fields]; |
124 | 124 | } |
125 | 125 | for (const field of fieldList) { |
126 | - _removeSchemaByFiled(field, schemaList); | |
126 | + _removeSchemaByFeild(field, schemaList); | |
127 | 127 | } |
128 | 128 | schemaRef.value = schemaList; |
129 | 129 | } |
... | ... | @@ -131,7 +131,7 @@ export function useFormEvents({ |
131 | 131 | /** |
132 | 132 | * @description: Delete based on field name |
133 | 133 | */ |
134 | - function _removeSchemaByFiled(field: string, schemaList: FormSchema[]): void { | |
134 | + function _removeSchemaByFeild(field: string, schemaList: FormSchema[]): void { | |
135 | 135 | if (isString(field)) { |
136 | 136 | const index = schemaList.findIndex((schema) => schema.field === field); |
137 | 137 | if (index !== -1) { |
... | ... | @@ -306,7 +306,7 @@ export function useFormEvents({ |
306 | 306 | updateSchema, |
307 | 307 | resetSchema, |
308 | 308 | appendSchemaByField, |
309 | - removeSchemaByFiled, | |
309 | + removeSchemaByFeild, | |
310 | 310 | resetFields, |
311 | 311 | setFieldsValue, |
312 | 312 | scrollToField, | ... | ... |
src/components/Form/src/types/form.ts
... | ... | @@ -33,7 +33,7 @@ export interface FormActionType { |
33 | 33 | updateSchema: (data: Partial<FormSchema> | Partial<FormSchema>[]) => Promise<void>; |
34 | 34 | resetSchema: (data: Partial<FormSchema> | Partial<FormSchema>[]) => Promise<void>; |
35 | 35 | setProps: (formProps: Partial<FormProps>) => Promise<void>; |
36 | - removeSchemaByFiled: (field: string | string[]) => Promise<void>; | |
36 | + removeSchemaByFeild: (field: string | string[]) => Promise<void>; | |
37 | 37 | appendSchemaByField: ( |
38 | 38 | schema: FormSchema, |
39 | 39 | prefixField: string | undefined, | ... | ... |
src/views/demo/form/AppendForm.vue
... | ... | @@ -21,7 +21,7 @@ |
21 | 21 | export default defineComponent({ |
22 | 22 | components: { BasicForm, CollapseContainer, PageWrapper, [Input.name]: Input, Button }, |
23 | 23 | setup() { |
24 | - const [register, { appendSchemaByField, removeSchemaByFiled, validate }] = useForm({ | |
24 | + const [register, { appendSchemaByField, removeSchemaByFeild, validate }] = useForm({ | |
25 | 25 | schemas: [ |
26 | 26 | { |
27 | 27 | field: 'field0a', |
... | ... | @@ -108,7 +108,7 @@ |
108 | 108 | } |
109 | 109 | |
110 | 110 | function del(field) { |
111 | - removeSchemaByFiled([`field${field}a`, `field${field}b`, `${field}`]); | |
111 | + removeSchemaByFeild([`field${field}a`, `field${field}b`, `${field}`]); | |
112 | 112 | n.value--; |
113 | 113 | } |
114 | 114 | ... | ... |
src/views/demo/form/DynamicForm.vue
... | ... | @@ -181,7 +181,7 @@ |
181 | 181 | export default defineComponent({ |
182 | 182 | components: { BasicForm, CollapseContainer, PageWrapper }, |
183 | 183 | setup() { |
184 | - const [register, { setProps, updateSchema, appendSchemaByField, removeSchemaByFiled }] = | |
184 | + const [register, { setProps, updateSchema, appendSchemaByField, removeSchemaByFeild }] = | |
185 | 185 | useForm({ |
186 | 186 | labelWidth: 120, |
187 | 187 | schemas, |
... | ... | @@ -229,7 +229,7 @@ |
229 | 229 | ); |
230 | 230 | } |
231 | 231 | function deleteField() { |
232 | - removeSchemaByFiled('field11'); | |
232 | + removeSchemaByFeild('field11'); | |
233 | 233 | } |
234 | 234 | return { |
235 | 235 | register, | ... | ... |