diff --git a/demo-workspace/src/index.ts b/demo-workspace/src/index.ts index 7e5308b..b52bbd3 100644 --- a/demo-workspace/src/index.ts +++ b/demo-workspace/src/index.ts @@ -101,6 +101,7 @@ import { IPublicModelPluginContext, IPublicModelResource, IPublicModelWindow, IP // 应用级左侧面板 await workspace.plugins.register(pluginViewManagerPane, { + init: controller.init, contextMenuActions: (ctx: IPublicModelPluginContext) => ([ { name: 'add', diff --git a/demo-workspace/src/viewController.tsx b/demo-workspace/src/viewController.tsx index 34933d3..e821b6c 100644 --- a/demo-workspace/src/viewController.tsx +++ b/demo-workspace/src/viewController.tsx @@ -1,10 +1,13 @@ import React from 'react'; import { Dialog, Form, Input, Button } from '@alifd/next'; -import * as pluginContext from "@alilc/lowcode-engine"; import { IPublicModelPluginContext, IPublicModelResource } from '@alilc/lowcode-types'; class Controller { - pluginContext?: IPublicModelPluginContext = pluginContext; + pluginContext?: IPublicModelPluginContext; + + init = (ctx: IPublicModelPluginContext) => { + this.pluginContext = ctx; + } onAddPage = () => { const dialog = Dialog.show({