mirror of
https://github.com/wanglin2/mind-map.git
synced 2026-02-17 22:08:25 +08:00
Feat:Node类改名为MindMapNode类,避免和HTML原生Node类冲突
This commit is contained in:
@@ -16,7 +16,7 @@ import {
|
||||
} from '../../../utils/index'
|
||||
|
||||
// 节点类
|
||||
class Node {
|
||||
class MindMapNode {
|
||||
// 构造函数
|
||||
constructor(opt = {}) {
|
||||
this.opt = opt
|
||||
@@ -1282,7 +1282,7 @@ class Node {
|
||||
// 伪克隆节点
|
||||
// 克隆出的节点并不能真正当做一个节点使用
|
||||
fakeClone() {
|
||||
const newNode = new Node({
|
||||
const newNode = new MindMapNode({
|
||||
...this.opt,
|
||||
uid: createUid()
|
||||
})
|
||||
@@ -1298,4 +1298,4 @@ class Node {
|
||||
}
|
||||
}
|
||||
|
||||
export default Node
|
||||
export default MindMapNode
|
||||
@@ -1,4 +1,4 @@
|
||||
import Node from './Node'
|
||||
import MindMapNode from './MindMapNode'
|
||||
import { createUid } from '../../../utils/index'
|
||||
|
||||
// 获取节点概要数据
|
||||
@@ -49,7 +49,7 @@ function createGeneralizationNode() {
|
||||
cur.generalizationLine = this.lineDraw.path()
|
||||
}
|
||||
if (!cur.generalizationNode) {
|
||||
cur.generalizationNode = new Node({
|
||||
cur.generalizationNode = new MindMapNode({
|
||||
data: {
|
||||
inserting: item.inserting,
|
||||
data: item
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import Node from '../core/render/node/Node'
|
||||
import MindMapNode from '../core/render/node/MindMapNode'
|
||||
import { CONSTANTS, initRootNodePositionMap } from '../constants/constant'
|
||||
import Lru from '../utils/Lru'
|
||||
import { createUid } from '../utils/index'
|
||||
@@ -190,7 +190,7 @@ class Base {
|
||||
} else {
|
||||
// 创建新节点
|
||||
const newUid = uid || createUid()
|
||||
newNode = new Node({
|
||||
newNode = new MindMapNode({
|
||||
data,
|
||||
uid: newUid,
|
||||
renderer: this.renderer,
|
||||
|
||||
@@ -13,7 +13,7 @@ import {
|
||||
nodeRichTextToTextWithWrap
|
||||
} from '../utils'
|
||||
import { CONSTANTS } from '../constants/constant'
|
||||
import MindMapNode from '../core/render/node/Node'
|
||||
import MindMapNode from '../core/render/node/MindMapNode'
|
||||
|
||||
let extended = false
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
replaceHtmlText,
|
||||
formatGetNodeGeneralization
|
||||
} from '../utils/index'
|
||||
import Node from '../core/render/node/Node'
|
||||
import MindMapNode from '../core/render/node/MindMapNode'
|
||||
import { CONSTANTS } from '../constants/constant'
|
||||
|
||||
// 搜索插件
|
||||
@@ -145,7 +145,7 @@ class Search {
|
||||
|
||||
// 判断对象是否是节点实例
|
||||
isNodeInstance(node) {
|
||||
return node instanceof Node
|
||||
return node instanceof MindMapNode
|
||||
}
|
||||
|
||||
// 搜索下一个,定位到下一个匹配节点
|
||||
|
||||
Reference in New Issue
Block a user