fix: form data that is not submitted by the form should not be carried when switching paging (#4847)
This commit is contained in:
@@ -66,11 +66,13 @@ const slots = useSlots();
|
||||
const [Form, formApi] = useTableForm({
|
||||
handleSubmit: async () => {
|
||||
const formValues = formApi.form.values;
|
||||
formApi.setLatestSubmissionValues(toRaw(formValues));
|
||||
props.api.reload(formValues);
|
||||
},
|
||||
handleReset: async () => {
|
||||
await formApi.resetForm();
|
||||
const formValues = formApi.form.values;
|
||||
formApi.setLatestSubmissionValues(formValues);
|
||||
props.api.reload(formValues);
|
||||
},
|
||||
commonConfig: {
|
||||
@@ -225,7 +227,9 @@ async function init() {
|
||||
}
|
||||
props.api?.setState?.({ gridOptions: defaultGridOptions });
|
||||
// form 由 vben-form 代替,所以需要保证query相关事件可以拿到参数
|
||||
extendProxyOptions(props.api, defaultGridOptions, () => formApi.form.values);
|
||||
extendProxyOptions(props.api, defaultGridOptions, () =>
|
||||
formApi.getLatestSubmissionValues(),
|
||||
);
|
||||
}
|
||||
|
||||
// formOptions支持响应式
|
||||
|
Reference in New Issue
Block a user