mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-26 03:48:12 +00:00
fix addon callbacks
This commit is contained in:
parent
642f155965
commit
61e19ebd25
@ -157,7 +157,7 @@ export class Node<Schema extends NodeSchema = NodeSchema> {
|
|||||||
this.props = new Props(this, props, extras);
|
this.props = new Props(this, props, extras);
|
||||||
this._children = new NodeChildren(this as ParentalNode, this.initialChildren(children));
|
this._children = new NodeChildren(this as ParentalNode, this.initialChildren(children));
|
||||||
this._children.interalInitParent();
|
this._children.interalInitParent();
|
||||||
this.props.import(this.transformProps(props || {}), extras);
|
this.props.import(this.transformProps(props || {}), this.transformProps(extras || {}));
|
||||||
this.setupAutoruns();
|
this.setupAutoruns();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -167,7 +167,6 @@ export class Node<Schema extends NodeSchema = NodeSchema> {
|
|||||||
private transformProps(props: any): any {
|
private transformProps(props: any): any {
|
||||||
// FIXME! support PropsList
|
// FIXME! support PropsList
|
||||||
return this.document.designer.transformProps(props, this, TransformStage.Init);
|
return this.document.designer.transformProps(props, this, TransformStage.Init);
|
||||||
// TODO: run transducers in metadata.experimental
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private autoruns?: Array<() => void>;
|
private autoruns?: Array<() => void>;
|
||||||
@ -542,14 +541,12 @@ export class Node<Schema extends NodeSchema = NodeSchema> {
|
|||||||
const _extras_: { [key: string]: any } = {
|
const _extras_: { [key: string]: any } = {
|
||||||
...extras,
|
...extras,
|
||||||
};
|
};
|
||||||
if (_extras_) {
|
Object.keys(this._addons).forEach((key) => {
|
||||||
Object.keys(_extras_).forEach((key) => {
|
|
||||||
const addon = this._addons[key];
|
const addon = this._addons[key];
|
||||||
if (addon) {
|
if (addon) {
|
||||||
_extras_[key] = addon();
|
_extras_[key] = addon();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
const schema: any = {
|
const schema: any = {
|
||||||
...baseSchema,
|
...baseSchema,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user