Skip to content

Commit

Permalink
fix: vxeGrid init without search form
Browse files Browse the repository at this point in the history
  • Loading branch information
mynetfan committed Jan 10, 2025
1 parent e10cbe2 commit da4ca48
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/@core/ui-kit/form-ui/src/form-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export class FormApi {

async getValues() {
const form = await this.getForm();
return this.handleRangeTimeValue(form.values);
return form.values ? this.handleRangeTimeValue(form.values) : {};
}

async isFieldValid(fieldName: string) {
Expand Down
5 changes: 4 additions & 1 deletion packages/effects/plugins/src/vxe-table/use-vxe-grid.vue
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,10 @@ async function init() {
const autoLoad = defaultGridOptions.proxyConfig?.autoLoad;
const enableProxyConfig = options.value.proxyConfig?.enabled;
if (enableProxyConfig && autoLoad) {
props.api.grid.commitProxy?.('_init', (await formApi.getValues()) ?? {});
props.api.grid.commitProxy?.(
'_init',
formOptions.value ? ((await formApi.getValues()) ?? {}) : {},
);
// props.api.reload(formApi.form?.values ?? {});
}
Expand Down

0 comments on commit da4ca48

Please sign in to comment.