fix: vxeGrid init without search form (#5342)
* 修复vxeGrid在未使用表单的情况下,自动加载数据失效的问题。 * 暂时将vxeGrid版本锁定在4.10.0,新版本尺寸计算尚有问题
This commit is contained in:
@@ -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) {
|
||||
|
@@ -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 ?? {});
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user