Feat:节点实例新增getAncestorNodes方法用于获取祖先节点列表
This commit is contained in:
parent
8b68b1fc48
commit
3b4195acc5
@ -1047,6 +1047,17 @@ class Node {
|
|||||||
return copyNodeTree({}, this, removeActiveState, removeId)
|
return copyNodeTree({}, this, removeActiveState, removeId)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取祖先节点列表
|
||||||
|
getAncestorNodes() {
|
||||||
|
const list = []
|
||||||
|
let parent = this.parent
|
||||||
|
while (parent) {
|
||||||
|
list.unshift(parent)
|
||||||
|
parent = parent.parent
|
||||||
|
}
|
||||||
|
return list
|
||||||
|
}
|
||||||
|
|
||||||
// 是否存在自定义样式
|
// 是否存在自定义样式
|
||||||
hasCustomStyle() {
|
hasCustomStyle() {
|
||||||
return this.style.hasCustomStyle()
|
return this.style.hasCustomStyle()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user