mirror of
https://github.com/wanglin2/mind-map.git
synced 2026-02-21 10:27:44 +08:00
Feat:节点增加getPureData方法获取该节点的纯数据
This commit is contained in:
parent
32fc6937d2
commit
b0dd90f5b3
@ -1,6 +1,6 @@
|
||||
import Style from './Style'
|
||||
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 nodeExpandBtnMethods from './nodeExpandBtn'
|
||||
import nodeCommandWrapsMethods from './nodeCommandWraps'
|
||||
@ -8,6 +8,7 @@ import nodeCreateContentsMethods from './nodeCreateContents'
|
||||
import nodeExpandBtnPlaceholderRectMethods from './nodeExpandBtnPlaceholderRect'
|
||||
import nodeCooperateMethods from './nodeCooperate'
|
||||
import { CONSTANTS } from '../../../constants/constant'
|
||||
import { copyNodeTree } from '../../../utils/index'
|
||||
|
||||
// 节点类
|
||||
class Node {
|
||||
@ -961,6 +962,11 @@ class Node {
|
||||
return key ? this.nodeData.data[key] : this.nodeData.data
|
||||
}
|
||||
|
||||
// 获取该节点的纯数据,即不包含对节点实例的引用
|
||||
getPureData(removeActiveState = true, removeId = false) {
|
||||
return copyNodeTree({}, this, removeActiveState, removeId)
|
||||
}
|
||||
|
||||
// 是否存在自定义样式
|
||||
hasCustomStyle() {
|
||||
return this.style.hasCustomStyle()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user