1、代码块引入组件

```typescript
/*
* 注入新建、编辑弹窗
*/
export function openCreateAndEditDialog(id, menuId = '1') { //注意方法前的export关键字
  let createDialogDom = document.getElementById("createReceiveUtilGroupComponent");
  if (createDialogDom == null) {
    createDialogDom = document.createElement("div");
    createDialogDom.setAttribute("id", "createReceiveUtilGroupComponent");
  }
  document.body.appendChild(createDialogDom);

  const close = (res = false) => {
    if(res){
      pageSdk.refresh("d5c4be2332e543c3a816b1e79ea0ba95");
    }
    const spanCom = <span />;
    ReactDOM.render(
      spanCom,
      document.getElementById("createReceiveUtilGroupComponent")
    )
  }
  const createDialogComp = <ReactRouterDOM.BrowserRouter>
    <CorsComponent
      app='@weapp/odocexchange'
      module={'odoc'}
      compName="OdocReceiveUtilGroupFormDialog"
      id={id}
      menuId={menuId}
      isPublicGroup={true}
      onClose={close}
    />
  </ReactRouterDOM.BrowserRouter>;
  ReactDOM.render(
    createDialogComp,
    document.getElementById("createReceiveUtilGroupComponent")
  )
}
```

2、调用：

```typescript
window.ebuilderSDK.getPageSDK().getExports().openCreateAndEditDialog("0");
```
