Feat:节点增加getPureData方法获取该节点的纯数据
This commit is contained in:
parent
32fc6937d2
commit
b0dd90f5b3
@ -1,6 +1,6 @@
|
|||||||
import Style from './Style'
|
import Style from './Style'
|
||||||
import Shape from './Shape'
|
import Shape from './Shape'
|
||||||
import { G, ForeignObject, SVG, Rect } from '@svgdotjs/svg.js'
|
import { G, ForeignObject, Rect } from '@svgdotjs/svg.js'
|
||||||
import nodeGeneralizationMethods from './nodeGeneralization'
|
import nodeGeneralizationMethods from './nodeGeneralization'
|
||||||
import nodeExpandBtnMethods from './nodeExpandBtn'
|
import nodeExpandBtnMethods from './nodeExpandBtn'
|
||||||
import nodeCommandWrapsMethods from './nodeCommandWraps'
|
import nodeCommandWrapsMethods from './nodeCommandWraps'
|
||||||
@ -8,6 +8,7 @@ import nodeCreateContentsMethods from './nodeCreateContents'
|
|||||||
import nodeExpandBtnPlaceholderRectMethods from './nodeExpandBtnPlaceholderRect'
|
import nodeExpandBtnPlaceholderRectMethods from './nodeExpandBtnPlaceholderRect'
|
||||||
import nodeCooperateMethods from './nodeCooperate'
|
import nodeCooperateMethods from './nodeCooperate'
|
||||||
import { CONSTANTS } from '../../../constants/constant'
|
import { CONSTANTS } from '../../../constants/constant'
|
||||||
|
import { copyNodeTree } from '../../../utils/index'
|
||||||
|
|
||||||
// 节点类
|
// 节点类
|
||||||
class Node {
|
class Node {
|
||||||
@ -961,6 +962,11 @@ class Node {
|
|||||||
return key ? this.nodeData.data[key] : this.nodeData.data
|
return key ? this.nodeData.data[key] : this.nodeData.data
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取该节点的纯数据,即不包含对节点实例的引用
|
||||||
|
getPureData(removeActiveState = true, removeId = false) {
|
||||||
|
return copyNodeTree({}, this, removeActiveState, removeId)
|
||||||
|
}
|
||||||
|
|
||||||
// 是否存在自定义样式
|
// 是否存在自定义样式
|
||||||
hasCustomStyle() {
|
hasCustomStyle() {
|
||||||
return this.style.hasCustomStyle()
|
return this.style.hasCustomStyle()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user