Commit 9aa2cf3ebff6f3d4087a1080208ec5f3c2c50f33

Authored by 前端爱码士
Committed by GitHub
1 parent b1f78c66

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

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