diff --git a/simple-mind-map/src/core/render/node/Node.js b/simple-mind-map/src/core/render/node/Node.js index bbbf2e57..813d517e 100644 --- a/simple-mind-map/src/core/render/node/Node.js +++ b/simple-mind-map/src/core/render/node/Node.js @@ -179,10 +179,12 @@ class Node { let { isUseCustomNodeContent, customCreateNodeContent } = this.mindMap.opt if (isUseCustomNodeContent && customCreateNodeContent) { this._customNodeContent = customCreateNodeContent(this) - this._customNodeContent.setAttribute('xmlns', 'http://www.w3.org/1999/xhtml') } // 如果没有返回内容,那么还是使用内置的节点内容 - if (this._customNodeContent) return + if (this._customNodeContent) { + this._customNodeContent.setAttribute('xmlns', 'http://www.w3.org/1999/xhtml') + return + } this._imgData = this.createImgNode() this._iconData = this.createIconNode() this._textData = this.createTextNode()