mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-03-07 02:47:12 +00:00
feat: 补充部分 API
This commit is contained in:
parent
f0fbde533a
commit
7df2d153f2
@ -262,8 +262,12 @@ export class Node<Schema extends NodeSchema = NodeSchema> {
|
|||||||
return this.isParental() && this.componentMeta.isContainer;
|
return this.isParental() && this.componentMeta.isContainer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isModal(): boolean {
|
||||||
|
return this.componentMeta.isModal;
|
||||||
|
}
|
||||||
|
|
||||||
isRoot(): boolean {
|
isRoot(): boolean {
|
||||||
return this.document.rootNode == (this as any);
|
return this.document.rootNode === (this as any);
|
||||||
}
|
}
|
||||||
|
|
||||||
isPage(): boolean {
|
isPage(): boolean {
|
||||||
|
|||||||
@ -67,6 +67,13 @@ export default class Node {
|
|||||||
return this[nodeSymbol].isComponent();
|
return this[nodeSymbol].isComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否为「模态框」节点
|
||||||
|
*/
|
||||||
|
get isModal() {
|
||||||
|
return this[nodeSymbol].isModal();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否为插槽节点
|
* 是否为插槽节点
|
||||||
*/
|
*/
|
||||||
@ -184,6 +191,13 @@ export default class Node {
|
|||||||
return Props.create(this[nodeSymbol].props);
|
return Props.create(this[nodeSymbol].props);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 返回节点的属性集
|
||||||
|
*/
|
||||||
|
get propsData() {
|
||||||
|
return this[nodeSymbol].propsData;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated use .children instead
|
* @deprecated use .children instead
|
||||||
*/
|
*/
|
||||||
@ -192,7 +206,7 @@ export default class Node {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated
|
* 获取节点实例对应的 dom 节点
|
||||||
*/
|
*/
|
||||||
getDOMNode() {
|
getDOMNode() {
|
||||||
return this[nodeSymbol].getDOMNode();
|
return this[nodeSymbol].getDOMNode();
|
||||||
@ -350,4 +364,19 @@ export default class Node {
|
|||||||
replaceWith(schema: NodeSchema) {
|
replaceWith(schema: NodeSchema) {
|
||||||
this[nodeSymbol].replaceWith(schema);
|
this[nodeSymbol].replaceWith(schema);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 选中当前节点实例
|
||||||
|
*/
|
||||||
|
select() {
|
||||||
|
this[nodeSymbol].select();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置悬停态
|
||||||
|
* @param flag
|
||||||
|
*/
|
||||||
|
hover(flag = true) {
|
||||||
|
this[nodeSymbol].hover(flag);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,10 +15,34 @@ export default class SettingPropEntry {
|
|||||||
return new SettingPropEntry(prop);
|
return new SettingPropEntry(prop);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取设置属性的 name
|
||||||
|
*/
|
||||||
|
get name() {
|
||||||
|
return this[settingPropEntrySymbol].name;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取设置属性的 key
|
||||||
|
*/
|
||||||
|
get key() {
|
||||||
|
return this[settingPropEntrySymbol].getKey();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取设置属性对应的节点实例
|
||||||
|
*/
|
||||||
get node(): Node | null {
|
get node(): Node | null {
|
||||||
return Node.create(this[settingPropEntrySymbol].getNode());
|
return Node.create(this[settingPropEntrySymbol].getNode());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取设置属性的父设置属性
|
||||||
|
*/
|
||||||
|
get parent(): SettingPropEntry {
|
||||||
|
return SettingPropEntry.create(this[settingPropEntrySymbol].parent as any);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated use .node instead
|
* @deprecated use .node instead
|
||||||
*/
|
*/
|
||||||
@ -26,6 +50,13 @@ export default class SettingPropEntry {
|
|||||||
return this.node;
|
return this.node;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @deprecated use .parent instead
|
||||||
|
*/
|
||||||
|
getParent() {
|
||||||
|
return this.parent;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置值
|
* 设置值
|
||||||
* @param val
|
* @param val
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user