File tree Expand file tree Collapse file tree 4 files changed +16
-6
lines changed
Expand file tree Collapse file tree 4 files changed +16
-6
lines changed Original file line number Diff line number Diff line change 88 SettingPropEntry ,
99 SettingTopEntry ,
1010 Selection ,
11+ Prop ,
1112} from '@alilc/lowcode-shell' ;
1213import { Node as InnerNode } from '@alilc/lowcode-designer' ;
1314
@@ -22,4 +23,5 @@ export default {
2223 SettingTopEntry,
2324 InnerNode,
2425 Selection,
26+ Prop,
2527} ;
Original file line number Diff line number Diff line change 99 settingPropEntrySymbol ,
1010 settingTopEntrySymbol ,
1111 designerCabinSymbol ,
12+ propSymbol ,
1213} from '@alilc/lowcode-shell' ;
1314
1415export default {
@@ -22,4 +23,5 @@ export default {
2223 settingPropEntrySymbol,
2324 settingTopEntrySymbol,
2425 designerCabinSymbol,
26+ propSymbol,
2527} ;
Original file line number Diff line number Diff line change @@ -170,10 +170,16 @@ export class Material implements IPublicApiMaterial {
170170 * 监听 assets 变化的事件
171171 * @param fn
172172 */
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+ } ;
178184 }
179185}
Original file line number Diff line number Diff line change @@ -104,5 +104,5 @@ export interface IPublicApiMaterial {
104104 * add callback for assets changed event
105105 * @param fn
106106 */
107- onChangeAssets ( fn : ( ) => void ) : void ;
107+ onChangeAssets ( fn : ( ) => void ) : Function ;
108108}
You can’t perform that action at this time.
0 commit comments