chore: 优化

This commit is contained in:
wuyue.xht 2020-06-22 09:51:06 +08:00
parent fa2482151d
commit 9915937e98
2 changed files with 3 additions and 4 deletions

View File

@ -1,4 +1,4 @@
import { obx, autorun, computed, getPublicPath, hotkey, focusTracker, globalContext, Editor } from '@ali/lowcode-editor-core'; import { obx, autorun, computed, getPublicPath, hotkey, focusTracker } from '@ali/lowcode-editor-core';
import { ISimulatorHost, Component, NodeInstance, ComponentInstance } from '../simulator'; import { ISimulatorHost, Component, NodeInstance, ComponentInstance } from '../simulator';
import Viewport from './viewport'; import Viewport from './viewport';
import { createSimulator } from './create-simulator'; import { createSimulator } from './create-simulator';
@ -266,7 +266,7 @@ export class BuiltinSimulatorHost implements ISimulatorHost<BuiltinSimulatorProp
selection.remove(id); selection.remove(id);
} else { } else {
selection.select(id); selection.select(id);
const editor = globalContext.get(Editor); const editor = this.designer?.editor;
const npm = node?.componentMeta?.npm; const npm = node?.componentMeta?.npm;
const selected = const selected =
[npm?.package, npm?.componentName].filter((item) => !!item).join('-') || [npm?.package, npm?.componentName].filter((item) => !!item).join('-') ||
@ -432,7 +432,7 @@ export class BuiltinSimulatorHost implements ISimulatorHost<BuiltinSimulatorProp
if (!node) { if (!node) {
return; return;
} }
const editor = globalContext.get(Editor); const editor = this.designer?.editor;
const npm = node?.componentMeta?.npm; const npm = node?.componentMeta?.npm;
const selected = const selected =
[npm?.package, npm?.componentName].filter((item) => !!item).join('-') || [npm?.package, npm?.componentName].filter((item) => !!item).join('-') ||

View File

@ -54,7 +54,6 @@ export default class Panel implements IWidget {
get content(): ReactNode { get content(): ReactNode {
const area = this.config?.area || this.parent?.name; const area = this.config?.area || this.parent?.name;
console.log(area);
if (this.plain) { if (this.plain) {
return createElement(PanelView, { return createElement(PanelView, {
panel: this, panel: this,