fix(table): `reload` in useTable not support await
修复useTable返回的reload方法不支持使用await等待加载完毕的问题
This commit is contained in:
parent
e85649bde2
commit
7b6d5e44a9
|
|
@ -3,6 +3,7 @@
|
||||||
- **BasicTable**
|
- **BasicTable**
|
||||||
- 修复可编辑单元格某些情况下无法提交的问题
|
- 修复可编辑单元格某些情况下无法提交的问题
|
||||||
- 修复`inset`属性不起作用的问题
|
- 修复`inset`属性不起作用的问题
|
||||||
|
- 修复`useTable`与`BasicTable`实例的`reload`方法`await`表现不一致的问题
|
||||||
- **BasicModal**
|
- **BasicModal**
|
||||||
- 修复点击遮罩、按下`Esc`键都不能关闭`Modal`的问题
|
- 修复点击遮罩、按下`Esc`键都不能关闭`Modal`的问题
|
||||||
- 修复点击关闭按钮、最大化按钮旁边的空白区域也会导致`Modal`关闭的问题
|
- 修复点击关闭按钮、最大化按钮旁边的空白区域也会导致`Modal`关闭的问题
|
||||||
|
|
|
||||||
|
|
@ -275,7 +275,7 @@ export function useDataSource(
|
||||||
setPagination({
|
setPagination({
|
||||||
current: currentTotalPage,
|
current: currentTotalPage,
|
||||||
});
|
});
|
||||||
fetch(opt);
|
return await fetch(opt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -295,6 +295,7 @@ export function useDataSource(
|
||||||
items: unref(resultItems),
|
items: unref(resultItems),
|
||||||
total: resultTotal,
|
total: resultTotal,
|
||||||
});
|
});
|
||||||
|
return resultItems;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
emit('fetch-error', error);
|
emit('fetch-error', error);
|
||||||
dataSourceRef.value = [];
|
dataSourceRef.value = [];
|
||||||
|
|
@ -319,7 +320,7 @@ export function useDataSource(
|
||||||
}
|
}
|
||||||
|
|
||||||
async function reload(opt?: FetchParams) {
|
async function reload(opt?: FetchParams) {
|
||||||
await fetch(opt);
|
return await fetch(opt);
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ export function useTable(tableProps?: Props): [
|
||||||
getForm: () => FormActionType;
|
getForm: () => FormActionType;
|
||||||
} = {
|
} = {
|
||||||
reload: async (opt?: FetchParams) => {
|
reload: async (opt?: FetchParams) => {
|
||||||
getTableInstance().reload(opt);
|
return await getTableInstance().reload(opt);
|
||||||
},
|
},
|
||||||
setProps: (props: Partial<BasicTableProps>) => {
|
setProps: (props: Partial<BasicTableProps>) => {
|
||||||
getTableInstance().setProps(props);
|
getTableInstance().setProps(props);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue