提交 d09406e3 编写于 作者: V vben

feat: add the parameter submitOnReset to the form (#54)

上级 74d47424
......@@ -266,7 +266,7 @@
}
async function resetFields(): Promise<any> {
const { resetFunc } = unref(getProps);
const { resetFunc, submitOnReset } = unref(getProps);
resetFunc && isFunction(resetFunc) && (await resetFunc());
const formEl = unref(formElRef);
if (!formEl) return;
......@@ -276,6 +276,7 @@
// const values = formEl.resetFields();
emit('reset', toRaw(formModel));
// return values;
submitOnReset && handleSubmit();
}
/**
......
......@@ -30,6 +30,10 @@ export const basicProps = {
type: Boolean,
default: true,
},
submitOnReset: {
type: Boolean,
default: false,
},
size: {
type: String as PropType<'default' | 'small' | 'large'>,
default: 'default',
......
......@@ -30,7 +30,8 @@ export type UseFormReturnType = [RegisterFn, FormActionType];
export interface FormProps {
// 整个表单所有项宽度
labelWidth?: number | string;
// 重置时提交
submitOnReset?: boolean;
// 整个表单通用Col配置
labelCol?: Partial<ColEx>;
// 整个表单通用Col配置
......
......@@ -9,6 +9,7 @@
<BasicForm
v-bind="getFormProps"
v-if="getBindValues.useSearchForm"
:submitOnReset="true"
:submitButtonOptions="{ loading }"
@register="registerForm"
@submit="handleSearchInfoChange"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册