Skip to content

Commit

Permalink
feat: 修复 getSchemaFullPath 异常
Browse files Browse the repository at this point in the history
  • Loading branch information
lhbxs committed Jan 4, 2024
1 parent b93c687 commit 45446c0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
5 changes: 1 addition & 4 deletions docs/table-render/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,7 @@ const Demo = () => {

return (
<TableRender
search={{
schema,
onSearch: () => alert(1),
}}
search={{ schema }}
request={api}
columns={columns}
title='最简表格'
Expand Down
6 changes: 3 additions & 3 deletions packages/form-render/src/models/formCoreUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,11 @@ export const getSchemaFullPath = (path: string, schema: any) => {

// 补全 object 类型 path 路径
let result = 'properties';
(path.split('.')).forEach(item => {
const pathList = path.split('.');
pathList.forEach((item, index) => {
const key = result + '.' + item;
const itemSchema = _get(schema, key, {});

if (isObjType(itemSchema)) {
if (isObjType(itemSchema) && index !== pathList.length-1) {
result = key + '.properties';
return ;
}
Expand Down
1 change: 0 additions & 1 deletion packages/table-render/src/core/SearchView/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ const Search: <RecordType extends object = any>(
if (typeof onSearch === 'function') {
onSearch(data);
}

refresh({ ...data, sorter });
};

Expand Down

0 comments on commit 45446c0

Please sign in to comment.