Fix:修复富文本编辑模式下当没有富文本节点时无法导出为图片的问题

This commit is contained in:
wanglin2 2023-03-24 10:27:13 +08:00
parent 5fa0ff7b5c
commit 81018bb615
2 changed files with 9 additions and 3 deletions

View File

@ -41,8 +41,10 @@ class Export {
let nodeWithDomToImg = null let nodeWithDomToImg = null
if (domToImage && this.mindMap.richText) { if (domToImage && this.mindMap.richText) {
let res = await this.mindMap.richText.handleSvgDomElements(svg) let res = await this.mindMap.richText.handleSvgDomElements(svg)
nodeWithDomToImg = res.svg if (res) {
svgHTML = res.svgHTML nodeWithDomToImg = res.svg
svgHTML = res.svgHTML
}
} }
return { return {
node: svg, node: svg,

View File

@ -416,7 +416,11 @@ class RichText {
reject(error) reject(error)
} }
} }
if (len > 0) transform() if (len > 0) {
transform()
} else {
resolve(null)
}
}) })
} }