GeezerVison is showing github.com — feat: added export of propSymbol and prop classes · IFTrue/lowcode-engine@0e18fee
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: packages/engine/src/modules/classes.ts +2Lines changed: 2 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 8 | 8 | SettingPropEntry, | 9 | 9 | SettingTopEntry, | 10 | 10 | Selection, | | 11 | + Prop, | 11 | 12 | } from '@alilc/lowcode-shell'; | 12 | 13 | import { Node as InnerNode } from '@alilc/lowcode-designer'; | 13 | 14 |
| @@ -22,4 +23,5 @@ export default { | 22 | 23 | SettingTopEntry, | 23 | 24 | InnerNode, | 24 | 25 | Selection, | | 26 | + Prop, | 25 | 27 | }; |
Collapse file Copy file name to clipboardExpand all lines: packages/engine/src/modules/symbols.ts +2Lines changed: 2 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 9 | 9 | settingPropEntrySymbol, | 10 | 10 | settingTopEntrySymbol, | 11 | 11 | designerCabinSymbol, | | 12 | + propSymbol, | 12 | 13 | } from '@alilc/lowcode-shell'; | 13 | 14 |
| 14 | 15 | export default { | @@ -22,4 +23,5 @@ export default { | 22 | 23 | settingPropEntrySymbol, | 23 | 24 | settingTopEntrySymbol, | 24 | 25 | designerCabinSymbol, | | 26 | + propSymbol, | 25 | 27 | }; |
Collapse file Copy file name to clipboardExpand all lines: packages/shell/src/api/material.ts +11-5Lines changed: 11 additions & 5 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -170,10 +170,16 @@ export class Material implements IPublicApiMaterial { | 170 | 170 | * 监听 assets 变化的事件 | 171 | 171 | * @param fn | 172 | 172 | */ | 173 | | - onChangeAssets(fn: () => void) { | 174 | | - // 设置 assets,经过 setAssets 赋值 | 175 | | - this[editorSymbol].onGot('assets', fn); | 176 | | - // 增量设置 assets,经过 loadIncrementalAssets 赋值 | 177 | | - this[editorSymbol].eventBus.on('designer.incrementalAssetsReady', fn); | | 173 | + onChangeAssets(fn: () => void): Function { | | 174 | + const dispose = [ | | 175 | + // 设置 assets,经过 setAssets 赋值 | | 176 | + this[editorSymbol].onGot('assets', fn), | | 177 | + // 增量设置 assets,经过 loadIncrementalAssets 赋值 | | 178 | + this[editorSymbol].eventBus.on('designer.incrementalAssetsReady', fn), | | 179 | + ]; | | 180 | + | | 181 | + return () => { | | 182 | + dispose.forEach(d => d && d()); | | 183 | + }; | 178 | 184 | } | 179 | 185 | } |
Collapse file Copy file name to clipboardExpand all lines: packages/types/src/shell/api/material.ts +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -104,5 +104,5 @@ export interface IPublicApiMaterial { | 104 | 104 | * add callback for assets changed event | 105 | 105 | * @param fn | 106 | 106 | */ | 107 | | - onChangeAssets(fn: () => void): void; | | 107 | + onChangeAssets(fn: () => void): Function; | 108 | 108 | } |
|