mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-01-25 02:58:43 +08:00
fix: 修复单词拼写错误,replace 'Filed' width 'Feild' (#2285)
This commit is contained in:
parent
b1f78c6696
commit
9aa2cf3ebf
@ -174,7 +174,7 @@
|
||||
updateSchema,
|
||||
resetSchema,
|
||||
appendSchemaByField,
|
||||
removeSchemaByFiled,
|
||||
removeSchemaByFeild,
|
||||
resetFields,
|
||||
scrollToField,
|
||||
} = useFormEvents({
|
||||
@ -268,7 +268,7 @@
|
||||
updateSchema,
|
||||
resetSchema,
|
||||
setProps,
|
||||
removeSchemaByFiled,
|
||||
removeSchemaByFeild,
|
||||
appendSchemaByField,
|
||||
clearValidate,
|
||||
validateFields,
|
||||
|
@ -79,8 +79,8 @@ export function useForm(props?: Props): UseFormReturnType {
|
||||
});
|
||||
},
|
||||
|
||||
removeSchemaByFiled: async (field: string | string[]) => {
|
||||
unref(formRef)?.removeSchemaByFiled(field);
|
||||
removeSchemaByFeild: async (field: string | string[]) => {
|
||||
unref(formRef)?.removeSchemaByFeild(field);
|
||||
},
|
||||
|
||||
// TODO promisify
|
||||
|
@ -112,7 +112,7 @@ export function useFormEvents({
|
||||
/**
|
||||
* @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));
|
||||
if (!fields) {
|
||||
return;
|
||||
@ -123,7 +123,7 @@ export function useFormEvents({
|
||||
fieldList = [fields];
|
||||
}
|
||||
for (const field of fieldList) {
|
||||
_removeSchemaByFiled(field, schemaList);
|
||||
_removeSchemaByFeild(field, schemaList);
|
||||
}
|
||||
schemaRef.value = schemaList;
|
||||
}
|
||||
@ -131,7 +131,7 @@ export function useFormEvents({
|
||||
/**
|
||||
* @description: Delete based on field name
|
||||
*/
|
||||
function _removeSchemaByFiled(field: string, schemaList: FormSchema[]): void {
|
||||
function _removeSchemaByFeild(field: string, schemaList: FormSchema[]): void {
|
||||
if (isString(field)) {
|
||||
const index = schemaList.findIndex((schema) => schema.field === field);
|
||||
if (index !== -1) {
|
||||
@ -306,7 +306,7 @@ export function useFormEvents({
|
||||
updateSchema,
|
||||
resetSchema,
|
||||
appendSchemaByField,
|
||||
removeSchemaByFiled,
|
||||
removeSchemaByFeild,
|
||||
resetFields,
|
||||
setFieldsValue,
|
||||
scrollToField,
|
||||
|
@ -33,7 +33,7 @@ export interface FormActionType {
|
||||
updateSchema: (data: Partial<FormSchema> | Partial<FormSchema>[]) => Promise<void>;
|
||||
resetSchema: (data: Partial<FormSchema> | Partial<FormSchema>[]) => Promise<void>;
|
||||
setProps: (formProps: Partial<FormProps>) => Promise<void>;
|
||||
removeSchemaByFiled: (field: string | string[]) => Promise<void>;
|
||||
removeSchemaByFeild: (field: string | string[]) => Promise<void>;
|
||||
appendSchemaByField: (
|
||||
schema: FormSchema,
|
||||
prefixField: string | undefined,
|
||||
|
@ -21,7 +21,7 @@
|
||||
export default defineComponent({
|
||||
components: { BasicForm, CollapseContainer, PageWrapper, [Input.name]: Input, Button },
|
||||
setup() {
|
||||
const [register, { appendSchemaByField, removeSchemaByFiled, validate }] = useForm({
|
||||
const [register, { appendSchemaByField, removeSchemaByFeild, validate }] = useForm({
|
||||
schemas: [
|
||||
{
|
||||
field: 'field0a',
|
||||
@ -108,7 +108,7 @@
|
||||
}
|
||||
|
||||
function del(field) {
|
||||
removeSchemaByFiled([`field${field}a`, `field${field}b`, `${field}`]);
|
||||
removeSchemaByFeild([`field${field}a`, `field${field}b`, `${field}`]);
|
||||
n.value--;
|
||||
}
|
||||
|
||||
|
@ -181,7 +181,7 @@
|
||||
export default defineComponent({
|
||||
components: { BasicForm, CollapseContainer, PageWrapper },
|
||||
setup() {
|
||||
const [register, { setProps, updateSchema, appendSchemaByField, removeSchemaByFiled }] =
|
||||
const [register, { setProps, updateSchema, appendSchemaByField, removeSchemaByFeild }] =
|
||||
useForm({
|
||||
labelWidth: 120,
|
||||
schemas,
|
||||
@ -229,7 +229,7 @@
|
||||
);
|
||||
}
|
||||
function deleteField() {
|
||||
removeSchemaByFiled('field11');
|
||||
removeSchemaByFeild('field11');
|
||||
}
|
||||
return {
|
||||
register,
|
||||
|
Loading…
Reference in New Issue
Block a user