虚拟组件不应有formData,创建组件时若缺少数据则直接返回
This commit is contained in:
parent
ea09d382aa
commit
0f9f60bddd
|
|
@ -146,6 +146,22 @@ const goCreate = async (
|
|||
}
|
||||
}
|
||||
|
||||
// 如果缺数据,退出
|
||||
if (
|
||||
!createComponentConfig.folderName ||
|
||||
!createComponentConfig.renderFile
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 如果不是虚拟组件,需要选择实体
|
||||
if (
|
||||
createComponentConfig.entityName !== '虚拟组件' &&
|
||||
(!createComponentConfig.isList || createComponentConfig.autoProjection)
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
let outputPath = join(folderPath, createComponentConfig.folderName);
|
||||
// 现在组件名称允许以/分割,合并到组件目录中
|
||||
if (createComponentConfig.folderName.includes('/')) {
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ export default OakComponent({
|
|||
},
|
||||
{{/if}}
|
||||
filters: [],
|
||||
{{#if isVirtual}}
|
||||
{{else}}
|
||||
formData({ data }) {
|
||||
return {
|
||||
{{#if isList}}
|
||||
|
|
@ -22,5 +24,6 @@ export default OakComponent({
|
|||
{{/if}}
|
||||
};
|
||||
},
|
||||
{{/if}}
|
||||
properties:{}
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue