mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-13 01:21:58 +00:00
feat: 支持 Node#wrapWith API
This commit is contained in:
parent
7ec3bf335d
commit
265a84fa6b
@ -145,7 +145,7 @@ export class BuiltinSimulatorHost implements ISimulatorHost<BuiltinSimulatorProp
|
||||
}
|
||||
|
||||
@computed get locale(): string {
|
||||
return this.get('locale') || '';
|
||||
return this.get('locale');
|
||||
}
|
||||
|
||||
@computed get deviceClassName(): string | undefined {
|
||||
|
||||
@ -456,8 +456,8 @@ export class Node<Schema extends NodeSchema = NodeSchema> {
|
||||
|
||||
/* istanbul ignore next */
|
||||
wrapWith(schema: Schema) {
|
||||
// this.replaceWith({ ...schema, children: [this.export()] });
|
||||
// this.children!.get(0)!.select();
|
||||
const wrappedNode = this.replaceWith({ ...schema, children: [this.export()] });
|
||||
return wrappedNode.children!.get(0);
|
||||
}
|
||||
|
||||
replaceWith(schema: Schema, migrate = false): any {
|
||||
@ -485,6 +485,7 @@ export class Node<Schema extends NodeSchema = NodeSchema> {
|
||||
if (selected) {
|
||||
this.document.selection.select(newNode.id);
|
||||
}
|
||||
return newNode;
|
||||
}
|
||||
return node;
|
||||
}
|
||||
|
||||
@ -332,7 +332,7 @@ export class SimulatorRendererContainer implements BuiltinSimulatorRenderer {
|
||||
@computed get device() {
|
||||
return this._device;
|
||||
}
|
||||
@obx.ref private _locale: string = '';
|
||||
@obx.ref private _locale: string | undefined = undefined;
|
||||
@computed get locale() {
|
||||
return this._locale;
|
||||
}
|
||||
|
||||
@ -53,7 +53,7 @@ export function liveEditingRule(target: EditingTarget) {
|
||||
}
|
||||
|
||||
const { innerText } = targetElement;
|
||||
const propTarget = ['title', 'label', 'text', 'content'].find(prop => {
|
||||
const propTarget = ['title', 'label', 'text', 'content', 'children'].find(prop => {
|
||||
return equalText(getText(node, prop), innerText);
|
||||
});
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user