mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-30 02:48:55 +08:00
fix:子表单上下文类型错误
This commit is contained in:
parent
03175e1df5
commit
8dfa6dfe8f
@ -10,7 +10,9 @@ import {
|
||||
getSchemaTpl,
|
||||
registerEditorPlugin,
|
||||
diff,
|
||||
JSONPipeOut
|
||||
JSONPipeOut,
|
||||
EditorNodeType,
|
||||
jsonToJsonSchema
|
||||
} from 'amis-editor-core';
|
||||
|
||||
export class SubFormControlPlugin extends BasePlugin {
|
||||
@ -208,6 +210,29 @@ export class SubFormControlPlugin extends BasePlugin {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async buildDataSchemas(
|
||||
node: EditorNodeType,
|
||||
region: EditorNodeType,
|
||||
trigger?: EditorNodeType
|
||||
) {
|
||||
// 渲染出来才能取到孩子,所以现在subform现在是拿不到的,so这里只提供基本类型,不展开
|
||||
let dataSchema: any = {
|
||||
type: 'object',
|
||||
title: node.schema?.label || node.schema?.name,
|
||||
originalValue: node.schema?.value // 记录原始值,循环引用检测需要
|
||||
};
|
||||
|
||||
if (node.schema?.multiple) {
|
||||
dataSchema = {
|
||||
type: 'array',
|
||||
title: node.schema?.label || node.schema?.name,
|
||||
originalValue: dataSchema.originalValue
|
||||
};
|
||||
}
|
||||
|
||||
return dataSchema;
|
||||
}
|
||||
}
|
||||
|
||||
registerEditorPlugin(SubFormControlPlugin);
|
||||
|
Loading…
Reference in New Issue
Block a user