Skip to content

在fetch中使用api获取parent对象designer与formCreate行为不一致 #740

@selfly

Description

@selfly

版本
@form-create/designer@3.2.8
@form-create/element-ui@3.2.13

使用designer重写了fetch调用,当触发的组件在子表单/分组内时,使用api获取parent对象为null。

  FcDesigner.designerForm.fetch = FcDesigner.formCreate.fetch = (options: any, fc: any) => {
    const parent = fc.api.parent; //此处返回null
    console.log(fc);
     console.log(parent);
}

在formCreate中正式渲染时,可以正常获取。

formCreate.fetch = (options: any, fc: any) => {
    const parent = fc.api.parent;  //此处正常返回父form对象
    console.log(fc);
    console.log(parent);
 };

期望的结果

两边可以保持一致的体验

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions