mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-03-06 02:11:56 +00:00
Merge branch develop into release/1.0.17-beta
This commit is contained in:
commit
ab817312ff
@ -69,6 +69,7 @@ import { LiveEditing } from './live-editing/live-editing';
|
||||
import { Project } from '../project';
|
||||
import { Scroller } from '../designer/scroller';
|
||||
import { isElementNode, isDOMNodeVisible } from '../utils/misc';
|
||||
import { debounce } from 'lodash';
|
||||
|
||||
export interface LibraryItem extends Package{
|
||||
package: string;
|
||||
@ -205,8 +206,10 @@ export class BuiltinSimulatorHost implements ISimulatorHost<BuiltinSimulatorProp
|
||||
transactionManager.onStartTransaction(() => {
|
||||
this.stopAutoRepaintNode();
|
||||
}, TransitionType.REPAINT);
|
||||
// 防止批量调用 transaction 时,执行多次 rerender
|
||||
const rerender = debounce(this.rerender.bind(this), 28);
|
||||
transactionManager.onEndTransaction(() => {
|
||||
this.rerender();
|
||||
rerender();
|
||||
this.enableAutoRepaintNode();
|
||||
}, TransitionType.REPAINT);
|
||||
}
|
||||
|
||||
@ -173,7 +173,7 @@ export class Prop implements IPropParent {
|
||||
const values = this.items!.map((prop) => {
|
||||
return prop.export(stage);
|
||||
});
|
||||
if (values.every(val => val === undefined)) {
|
||||
if (values.every((val) => val === undefined)) {
|
||||
return undefined;
|
||||
}
|
||||
return values;
|
||||
@ -314,14 +314,21 @@ export class Prop implements IPropParent {
|
||||
@action
|
||||
setAsSlot(data: JSSlot) {
|
||||
this._type = 'slot';
|
||||
const slotSchema: SlotSchema = {
|
||||
componentName: 'Slot',
|
||||
title: data.title,
|
||||
id: data.id,
|
||||
name: data.name,
|
||||
params: data.params,
|
||||
children: data.value,
|
||||
};
|
||||
let slotSchema: SlotSchema;
|
||||
// 当 data.value 的结构为 { componentName: 'Slot' } 时,直接当成 slotSchema 使用
|
||||
if ((isPlainObject(data.value) && data.value?.componentName === 'Slot')) {
|
||||
slotSchema = data.value as SlotSchema;
|
||||
} else {
|
||||
slotSchema = {
|
||||
componentName: 'Slot',
|
||||
title: data.title,
|
||||
id: data.id,
|
||||
name: data.name,
|
||||
params: data.params,
|
||||
children: data.value,
|
||||
};
|
||||
}
|
||||
|
||||
if (this._slotNode) {
|
||||
this._slotNode.import(slotSchema);
|
||||
} else {
|
||||
|
||||
@ -26,4 +26,4 @@ export * from './node-helper';
|
||||
export * from './clone-enumerable-property';
|
||||
export * from './logger';
|
||||
export * as css from './css-helper';
|
||||
export { transactionManager } from './start-transaction';
|
||||
export { transactionManager } from './transaction-manager';
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user