feat: added export of propSymbol and prop classes

This commit is contained in:
liujuping 2023-02-01 21:41:57 +08:00 committed by 林熠
parent a42f538b06
commit 0e18feeb6e
4 changed files with 16 additions and 6 deletions

View File

@ -8,6 +8,7 @@ import {
SettingPropEntry,
SettingTopEntry,
Selection,
Prop,
} from '@alilc/lowcode-shell';
import { Node as InnerNode } from '@alilc/lowcode-designer';
@ -22,4 +23,5 @@ export default {
SettingTopEntry,
InnerNode,
Selection,
Prop,
};

View File

@ -9,6 +9,7 @@ import {
settingPropEntrySymbol,
settingTopEntrySymbol,
designerCabinSymbol,
propSymbol,
} from '@alilc/lowcode-shell';
export default {
@ -22,4 +23,5 @@ export default {
settingPropEntrySymbol,
settingTopEntrySymbol,
designerCabinSymbol,
propSymbol,
};

View File

@ -170,10 +170,16 @@ export class Material implements IPublicApiMaterial {
* assets
* @param fn
*/
onChangeAssets(fn: () => void) {
// 设置 assets经过 setAssets 赋值
this[editorSymbol].onGot('assets', fn);
// 增量设置 assets经过 loadIncrementalAssets 赋值
this[editorSymbol].eventBus.on('designer.incrementalAssetsReady', fn);
onChangeAssets(fn: () => void): Function {
const dispose = [
// 设置 assets经过 setAssets 赋值
this[editorSymbol].onGot('assets', fn),
// 增量设置 assets经过 loadIncrementalAssets 赋值
this[editorSymbol].eventBus.on('designer.incrementalAssetsReady', fn),
];
return () => {
dispose.forEach(d => d && d());
};
}
}

View File

@ -104,5 +104,5 @@ export interface IPublicApiMaterial {
* add callback for assets changed event
* @param fn
*/
onChangeAssets(fn: () => void): void;
onChangeAssets(fn: () => void): Function;
}