Skip to content

Commit

Permalink
refactor(core): change defaultComponentTree type ITreeNode[] to ITree…
Browse files Browse the repository at this point in the history
…Node
  • Loading branch information
janryWang committed Sep 22, 2021
1 parent 611e9e6 commit 40b2af7
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion packages/core/src/models/Engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ export class Engine extends Event {
shortcuts: [],
effects: [],
drivers: [],
defaultComponentTree: [],
rootComponentName: 'Root',
sourceIdAttrName: 'data-designer-source-id',
nodeIdAttrName: 'data-designer-node-id',
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/models/Operation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ export class Operation {
this.workspace = workspace
this.tree = new TreeNode({
componentName: this.engine.props.rootComponentName,
...this.engine.props.defaultComponentTree,
operation: this,
children: this.engine.props.defaultComponentTree,
})
this.selection = new Selection({
operation: this,
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export type IEngineProps<T = Event> = IEventProps<T> & {
clickStopPropagationAttrName?: string //点击阻止冒泡属性
outlineNodeIdAttrName?: string //大纲树节点ID的dom属性名
nodeHelpersIdAttrName?: string //节点工具栏属性名
defaultComponentTree?: ITreeNode[] //默认组件树
defaultComponentTree?: ITreeNode //默认组件树
defaultScreenType?: ScreenType
rootComponentName?: string
}
Expand Down

0 comments on commit 40b2af7

Please sign in to comment.