mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-03-03 07:47:18 +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 {
|
@computed get locale(): string {
|
||||||
return this.get('locale') || '';
|
return this.get('locale');
|
||||||
}
|
}
|
||||||
|
|
||||||
@computed get deviceClassName(): string | undefined {
|
@computed get deviceClassName(): string | undefined {
|
||||||
|
|||||||
@ -456,8 +456,8 @@ export class Node<Schema extends NodeSchema = NodeSchema> {
|
|||||||
|
|
||||||
/* istanbul ignore next */
|
/* istanbul ignore next */
|
||||||
wrapWith(schema: Schema) {
|
wrapWith(schema: Schema) {
|
||||||
// this.replaceWith({ ...schema, children: [this.export()] });
|
const wrappedNode = this.replaceWith({ ...schema, children: [this.export()] });
|
||||||
// this.children!.get(0)!.select();
|
return wrappedNode.children!.get(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
replaceWith(schema: Schema, migrate = false): any {
|
replaceWith(schema: Schema, migrate = false): any {
|
||||||
@ -485,6 +485,7 @@ export class Node<Schema extends NodeSchema = NodeSchema> {
|
|||||||
if (selected) {
|
if (selected) {
|
||||||
this.document.selection.select(newNode.id);
|
this.document.selection.select(newNode.id);
|
||||||
}
|
}
|
||||||
|
return newNode;
|
||||||
}
|
}
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -332,7 +332,7 @@ export class SimulatorRendererContainer implements BuiltinSimulatorRenderer {
|
|||||||
@computed get device() {
|
@computed get device() {
|
||||||
return this._device;
|
return this._device;
|
||||||
}
|
}
|
||||||
@obx.ref private _locale: string = '';
|
@obx.ref private _locale: string | undefined = undefined;
|
||||||
@computed get locale() {
|
@computed get locale() {
|
||||||
return this._locale;
|
return this._locale;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -53,7 +53,7 @@ export function liveEditingRule(target: EditingTarget) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const { innerText } = targetElement;
|
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);
|
return equalText(getText(node, prop), innerText);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user